chore: remove useless migration normalization
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled

This commit is contained in:
Nicolas Meienberger 2026-02-17 20:50:23 +01:00
parent 1321b15c0d
commit 705f5c75cb

View file

@ -19,20 +19,6 @@ export const db = drizzle({ client: sqlite, relations, schema });
let migrationsPromise: Promise<void> | undefined;
const normalizeLegacyMigrationTimestamps = () => {
const drizzleMigrationsTableExists = sqlite
.query("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = '__drizzle_migrations' LIMIT 1")
.get();
if (!drizzleMigrationsTableExists) {
return;
}
sqlite.run(
"UPDATE __drizzle_migrations SET created_at = CAST(created_at / 1000 AS INTEGER) * 1000 WHERE created_at % 1000 != 0",
);
};
const runMigrations = async () => {
let migrationsFolder: string;
@ -44,8 +30,6 @@ const runMigrations = async () => {
migrationsFolder = path.join(process.cwd(), "app", "drizzle");
}
normalizeLegacyMigrationTimestamps();
migrate(db, { migrationsFolder });
sqlite.run("PRAGMA foreign_keys = ON;");