summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--util/src/migrations/1634426540271-MigrationTimestamp.ts15
-rw-r--r--util/src/util/Database.ts2
2 files changed, 16 insertions, 1 deletions
diff --git a/util/src/migrations/1634426540271-MigrationTimestamp.ts b/util/src/migrations/1634426540271-MigrationTimestamp.ts
new file mode 100644
index 00000000..3208b25b
--- /dev/null
+++ b/util/src/migrations/1634426540271-MigrationTimestamp.ts
@@ -0,0 +1,15 @@
+import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
+
+export class MigrationTimestamp1634426540271 implements MigrationInterface {
+	name = "MigrationTimestamp1634426540271";
+
+	public async up(queryRunner: QueryRunner): Promise<void> {
+		await queryRunner.changeColumn(
+			"migrations",
+			"timestamp",
+			new TableColumn({ name: "timestampe", type: "bigint", isNullable: false })
+		);
+	}
+
+	public async down(queryRunner: QueryRunner): Promise<void> {}
+}
diff --git a/util/src/util/Database.ts b/util/src/util/Database.ts
index c71ebbd4..6124ffab 100644
--- a/util/src/util/Database.ts
+++ b/util/src/util/Database.ts
@@ -49,7 +49,7 @@ export function initDatabase(): Promise<Connection> {
 					connection.migrations.map((x) => ({
 						id: i++,
 						name: x.name,
-						timestamp: Math.floor(Date.now() / 1000),
+						timestamp: Date.now(),
 					}))
 				);
 			}