UNPKG

884 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('mails', {
19 id: { type: 'int', primaryKey: true, autoIncrement: true}, //日志编号
20 src: {type: 'string', length: 100},
21 dst: {type: 'string', length: 100},
22 content: {type: 'string', length: 1000},
23 time: {type: 'int'},
24 state: {type: 'int', defaultValue:0},
25 sn: {type: 'string', length: 100},
26 });
27};
28
29exports.down = function(db) {
30 return db.dropTable('mails').then(
31 function(result) {
32 },
33 function(err) {
34 }
35 );
36};
37
38exports._meta = {
39 "version": 1
40};