mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2026-10-31 06:01:40 +00:00
Lots of stuff
This commit is contained in:
commit
d7316d5799
6681 files changed
+527969
No files matched your search
@@ -0,0 +1,12 @@
|
||||
|
||||
exports.up = (knex, Promise) ->
|
||||
knex.schema.createTable 'teams', (t) ->
|
||||
t.increments()
|
||||
t.integer('trainer_id').index().notNull()
|
||||
t.string('name').notNull()
|
||||
t.string('generation').notNull()
|
||||
t.json('contents')
|
||||
t.timestamps()
|
||||
|
||||
exports.down = (knex, Promise) ->
|
||||
knex.schema.dropTableIfExists 'teams'
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
exports.up = (knex, Promise) ->
|
||||
knex.raw('ALTER TABLE teams ALTER COLUMN name DROP NOT NULL')
|
||||
.then ->
|
||||
knex.raw('ALTER TABLE teams ALTER COLUMN generation DROP NOT NULL')
|
||||
|
||||
|
||||
exports.down = (knex, Promise) ->
|
||||
knex.raw('ALTER TABLE teams ALTER COLUMN name SET NOT NULL')
|
||||
.then ->
|
||||
knex.raw('ALTER TABLE teams ALTER COLUMN generation SET NOT NULL')
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
exports.up = (knex, Promise) ->
|
||||
knex.schema.createTable 'battles', (t) ->
|
||||
t.increments()
|
||||
t.string('battle_id').index().unique().notNull()
|
||||
t.string('name')
|
||||
t.string('players').notNull()
|
||||
t.string('format').notNull()
|
||||
t.integer('num_active').notNull()
|
||||
t.json('versions')
|
||||
t.json('contents').notNull()
|
||||
t.timestamps()
|
||||
|
||||
exports.down = (knex, Promise) ->
|
||||
knex.schema.dropTableIfExists 'battles'
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
exports.up = (knex, Promise) ->
|
||||
knex.schema.createTable 'saved_battles', (t) ->
|
||||
t.increments()
|
||||
t.string('battle_id').index().notNull()
|
||||
t.integer('user_id').index().notNull()
|
||||
t.unique(['battle_id', 'user_id'])
|
||||
t.timestamps()
|
||||
|
||||
exports.down = (knex, Promise) ->
|
||||
knex.schema.dropTableIfExists 'saved_battles'
|
||||
Reference in new issue
Block a user