This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var Bookshelf = require('bookshelf'), | ||
Q = require('q'); | ||
|
||
var conf = require('./config'); | ||
var DB = Bookshelf.initialize(conf.database); | ||
|
||
var Workshop = DB.Model.extend({ | ||
tableName: 'workshops' | ||
}); | ||
|
||
var workshops = [ | ||
{name: 'Listening++', slot: 1, url: 'http://turkuagileday.fi/topics/#listening', date: '2014-05-12'}, | ||
{name: 'The Agile-ish Github Flow', slot: 1, url: 'http://turkuagileday.fi/topics/#github-flow', date: '2014-05-12'}, | ||
{name: 'Retrospective facilitation 101', slot: 1, url: 'http://turkuagileday.fi/topics/#retrospective-facilitation', date: '2014-05-12'}, | ||
{name: 'Pitching Agile', slot: 2, url: 'http://turkuagileday.fi/topics/#pitching-agile', date: '2014-05-12'}, | ||
{name: 'TBA', slot: 2, url: '', date: '2014-05-12'}, | ||
{name: 'TBA', slot: 2, url: '', date: '2014-05-12'}, | ||
]; | ||
|
||
workshops.reduce(function(pr, ws) { | ||
return pr.then(function() { | ||
var model = new Workshop(ws); | ||
return model.save(); | ||
}); | ||
}, Q()).then(function() { | ||
console.log('All workshops inserted'); | ||
process.exit(0); | ||
}, function(err) { | ||
console.error('Failed to insert', err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
exports.up = function(knex, Promise) { | ||
return knex.schema.table('workshops', function(table) { | ||
table.string('url'); | ||
}); | ||
|
||
}; | ||
|
||
exports.down = function(knex, Promise) { | ||
return knex.schema.table('workshops', function(table) { | ||
table.dropColumn('url'); | ||
}); | ||
}; |