split per app

This commit is contained in:
2020-08-16 11:48:06 +02:00
parent d3a19c953a
commit c5be16963d
12 changed files with 126 additions and 14 deletions

View File

@@ -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
}