more renaming

This commit is contained in:
ntr
2019-05-25 15:52:37 +10:00
parent 6a20e72a64
commit 7e2a95204e
13 changed files with 23 additions and 59 deletions
-10
View File
@@ -1,5 +1,3 @@
const NULL_UUID = '00000000-0000-0000-0000-000000000000';
exports.up = async knex => {
await knex.schema.createTable('games', table => {
table.uuid('id').primary();
@@ -67,14 +65,6 @@ exports.up = async knex => {
.inTable('games')
.onDelete('NO ACTION');
});
// not really sure if this is a good idea
await knex('instances').insert({
id: NULL_UUID,
data: 'INVALID',
open: false,
});
};
exports.down = async () => {};
-28
View File
@@ -1,28 +0,0 @@
exports.up = async knex => {
await knex.schema.createTable('zones', async (table) => {
table.uuid('id').primary();
table.index('id');
table.timestamps(true, true);
table.binary('data').notNullable();
table.boolean('active')
.defaultTo(true)
.notNullable();
table.uuid('account').notNullable()
table.foreign('account')
.references('id')
.inTable('accounts')
.onDelete('CASCADE');
table.index('account');
await knex.schema.raw(
// eslint-disable-next-line max-len
'CREATE UNIQUE INDEX zones_account_active ON zones (account) WHERE active = true;'
);
});
};
exports.down = async () => {};