2020-07-01 17:54:32 +00:00
|
|
|
const players = ["white", "black"];
|
2020-01-21 07:19:22 +00:00
|
|
|
|
2020-07-01 17:54:32 +00:00
|
|
|
exports.up = (knex) => {
|
|
|
|
return knex.schema.createTable("move", (table) => {
|
|
|
|
table.increments("id").primary();
|
|
|
|
table.enu("player", players).notNullable();
|
|
|
|
table.integer("point_x").notNullable();
|
|
|
|
table.integer("point_y").notNullable();
|
|
|
|
table.integer("number").notNullable();
|
|
|
|
table.boolean("game_record").notNullable().default(true);
|
|
|
|
table.boolean("placement").notNullable().default(false);
|
2020-01-21 07:19:22 +00:00
|
|
|
|
2020-07-01 17:54:32 +00:00
|
|
|
table.integer("game").references("id").inTable("game").notNullable();
|
|
|
|
table.integer("prior_move").references("id").inTable("move");
|
2020-01-21 07:19:22 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-07-01 17:54:32 +00:00
|
|
|
exports.down = (knex) => knex.schema.dropTableIfExists("move");
|