From e32942183e6a99af9a6164a07a2f5fe236cc2bdb Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Mon, 4 Apr 2022 17:39:32 +0200
Subject: [PATCH] feat: #be add timestamps everywhere in db

---
 backend/migrations/20220404144303_timestamps.ts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 backend/migrations/20220404144303_timestamps.ts

diff --git a/backend/migrations/20220404144303_timestamps.ts b/backend/migrations/20220404144303_timestamps.ts
new file mode 100644
index 0000000..b812661
--- /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());
+}
-- 
GitLab