UNPKG

821 BJavaScriptView Raw
1'use strict';
2
3var dbm;
4var type;
5var seed;
6
7/**
8 * We receive the dbmigrate dependency from dbmigrate initially.
9 * This enables us to not have to rely on NODE_PATH.
10 */
11exports.setup = function(options, seedLink) {
12 dbm = options.dbmigrate;
13 type = dbm.dataType;
14 seed = seedLink;
15};
16
17exports.up = function(db) {
18 return db.createTable('ally_news', {
19 id: { type: 'int', autoIncrement: true, primaryKey: true},
20 aid: {type: 'int', defaultValue: 0},
21 newstype: {type: 'int', defaultValue: 0},
22 content: {type: 'string', length: 500},
23 buildTime: {type: 'int', defaultValue: 0},
24 });
25};
26
27exports.down = function(db) {
28 return db.dropTable('ally_news').then(
29 function(result) {
30 },
31 function(err) {
32 }
33 );
34};
35
36exports._meta = {
37 "version": 1
38};