Skip to content
Snippets Groups Projects
Commit 7cddffe5 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: #be tables for games, clues and shots

parent f410d0ed
No related branches found
No related tags found
No related merge requests found
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable("games", function (table) {
table.uuid("id").primary().defaultTo(knex.raw("gen_random_uuid()"));
table.timestamp("began_at");
table.timestamp("ended_at");
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable("games");
}
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable("clues", function (table) {
table.uuid("id").primary().defaultTo(knex.raw("gen_random_uuid()"));
table.uuid("game_id").references("games.id").notNullable();
table.uuid("word_id").references("words.id").notNullable();
table.timestamp("began_at");
table.timestamp("ended_at");
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable("clues");
}
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable("shots", function (table) {
table.uuid("id").primary().defaultTo(knex.raw("gen_random_uuid()"));
table.uuid("game_id").references("games.id").notNullable();
table.uuid("clue_id").references("clues.id");
table.timestamp("began_at");
table.timestamp("ended_at");
table.string("typed");
table.string("final");
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable("shots");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment