split per app
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
async function up (knex) {
|
||||
async function create_app (knex) {
|
||||
await knex.schema.createTable ('app', (table) => {
|
||||
table.increments ('id');
|
||||
table.string ('name');
|
||||
});
|
||||
}
|
||||
|
||||
async function create_log (knex) {
|
||||
await knex.schema.createTable ('log', (table) => {
|
||||
table.increments ('id');
|
||||
table.string ('app');
|
||||
table.integer ('app_id')
|
||||
.references ('id')
|
||||
.inTable ('app');
|
||||
table.string ('message');
|
||||
table.json ('data');
|
||||
table.timestamp ('timestamp');
|
||||
});
|
||||
}
|
||||
|
||||
async function up (knex) {
|
||||
await create_app (knex);
|
||||
await create_log (knex);
|
||||
}
|
||||
|
||||
function down () {
|
||||
// noop
|
||||
}
|
||||
|
Reference in New Issue
Block a user