diff options
| author | Kana <[email protected]> | 2021-01-08 19:48:25 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-08 19:48:25 +0900 |
| commit | 3cfb2721ce64ab94fdbc9c97b54602acc3c654be (patch) | |
| tree | b427becf78c51081e58f1b2af98b2662f7626a39 /src/api/database/migrations/20210105222742_addStatisticsTable.js | |
| parent | Merge pull request #248 from WeebDev/feature/stats-dashboard (diff) | |
| parent | fix: pg driver doesn't return anything without .returning() (diff) | |
| download | host.fuwn.me-3cfb2721ce64ab94fdbc9c97b54602acc3c654be.tar.xz host.fuwn.me-3cfb2721ce64ab94fdbc9c97b54602acc3c654be.zip | |
Merge pull request #250 from Zephyrrus/feature/system_status_page
Feature/system status page
Diffstat (limited to 'src/api/database/migrations/20210105222742_addStatisticsTable.js')
| -rw-r--r-- | src/api/database/migrations/20210105222742_addStatisticsTable.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/api/database/migrations/20210105222742_addStatisticsTable.js b/src/api/database/migrations/20210105222742_addStatisticsTable.js new file mode 100644 index 0000000..d920ac1 --- /dev/null +++ b/src/api/database/migrations/20210105222742_addStatisticsTable.js @@ -0,0 +1,16 @@ + +exports.up = async knex => { + await knex.schema.createTable('statistics', table => { + table.increments(); + table.integer('batchId'); + table.string('type'); + table.json('data'); + table.timestamp('createdAt'); + + table.unique(['batchId', 'type']); + }); +}; + +exports.down = async knex => { + await knex.schema.dropTableIfExists('statistics'); +}; |