rename battle -> game

This commit is contained in:
ntr
2018-10-20 12:06:00 +11:00
parent 9419b1cc3d
commit 5a3a126086
15 changed files with 163 additions and 123 deletions
+40
View File
@@ -0,0 +1,40 @@
exports.up = async knex => {
knex.schema.createTable('games', table => {
table.uuid('id').primary();
table.timestamps();
table.binary('data').notNullable();
table.index('id');
});
knex.schema.createTable('combatants', table => {
table.uuid('id').primary();
table.index('id');
// the game itself
table.uuid('game').notNullable()
table.foreign('game')
.references('id')
.inTable('games')
.onDelete('CASCADE');
table.index('game');
// cryp in a game
table.uuid('cryp').notNullable()
table.foreign('cryp')
.references('id')
.inTable('cryps')
.onDelete('CASCADE');
table.index('cryp');
// account in a game
table.uuid('account').notNullable()
table.foreign('account')
.references('id')
.inTable('accounts')
.onDelete('CASCADE');
table.index('account');
});
};
exports.down = async () => {};