diff --git a/backend/migrations/20220404144303_timestamps.ts b/backend/migrations/20220404144303_timestamps.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8126616133389484bc6bc8bb5cffc3e274df6e1 --- /dev/null +++ b/backend/migrations/20220404144303_timestamps.ts @@ -0,0 +1,17 @@ +import { Knex } from "knex"; + +export async function up(knex: Knex): Promise<void> { + knex.schema + .alterTable("words", (table) => table.timestamps()) + .alterTable("games", (table) => table.timestamps()) + .alterTable("clues", (table) => table.timestamps()) + .alterTable("shots", (table) => table.timestamps()); +} + +export async function down(knex: Knex): Promise<void> { + knex.schema + .alterTable("words", (table) => table.dropTimestamps()) + .alterTable("games", (table) => table.dropTimestamps()) + .alterTable("clues", (table) => table.dropTimestamps()) + .alterTable("shots", (table) => table.dropTimestamps()); +}