diff --git a/server/Recorder.js b/server/Recorder.js index 48eeae8..fe34c8a 100644 --- a/server/Recorder.js +++ b/server/Recorder.js @@ -17,19 +17,19 @@ export default class Recorder { if (!await this.db.schema.hasTable('veh_lines')) { await this.db.schema.createTable('veh_lines', t => { + t.timestamp('date', { useTz: false }).defaultTo(this.db.fn.now()); t.smallint('vehicle').notNullable(); t.string('line', 32).nullable(); // 4, 9.... - t.timestamp('date', { useTz: false }).defaultTo(this.db.fn.now()); }); } if (!await this.db.schema.hasTable('veh_pos')) { await this.db.schema.createTable('veh_pos', t => { - t.smallint('vehicle').notNullable(); - t.smallint('line').nullable(); t.timestamp('date', { useTz: false }).defaultTo(this.db.fn.now()); t.float('lat').nullable(); t.float('long').nullable(); + t.smallint('vehicle').notNullable(); + t.smallint('line').nullable(); }); } }