UNPKG

1.54 kBJavaScriptView 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('buylogs', {
19 id: { type: 'int', primaryKey: true, autoIncrement: true}, //日志编号
20 domainid: {type: 'string', length: 128}, //用户编号
21 third_no: {type: 'string', length: 128}, //外部系统订单编码
22 trade_no: {type: 'string', length: 128, unique: true}, //内部系统订单编码
23 total_fee: {type: 'bigint'}, //总费用,单位为当前使用货币的最小单位,如 CNY 为分
24 fee_type: {type: 'string', length: 50}, //费用类型,默认 CNY
25 product: {type: 'string', length: 128}, //商品内容
26 product_desc: {type: 'string', length: 255}, //商品描述
27 result: {type: 'smallint'}, //状态
28 createdAt: {type: 'datetime'}, //创建时间
29 updatedAt: {type: 'datetime'}, //更新时间
30});
31};
32
33exports.down = function(db) {
34 return db.dropTable('buylogs').then(
35 function(result) {
36 },
37 function(err) {
38 }
39 );
40};
41
42exports._meta = {
43 "version": 1
44};