From 4ecef50bcd6e4957411641c93c88816cb3c491bd Mon Sep 17 00:00:00 2001 From: Ryan Florence Date: Fri, 29 Nov 2024 16:47:50 -0700 Subject: [PATCH] rename internal migrations table --- src/lib/migrate.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/migrate.ts b/src/lib/migrate.ts index 5af152f..b0a8e02 100644 --- a/src/lib/migrate.ts +++ b/src/lib/migrate.ts @@ -126,10 +126,10 @@ export class Migrator { query.run(); if (direction === "up") { db.prepare( - "INSERT INTO migrations (id, name, applied_at) VALUES (?, ?, ?)", + "INSERT INTO _migralite (id, name, applied_at) VALUES (?, ?, ?)", ).run(id, fileName, new Date().toISOString()); } else { - db.prepare("DELETE FROM migrations WHERE id = ?").run(id); + db.prepare("DELETE FROM _migralite WHERE id = ?").run(id); } })(); } @@ -143,7 +143,7 @@ export class Migrator { private async initDb() { this.db.exec(` - CREATE TABLE IF NOT EXISTS migrations ( + CREATE TABLE IF NOT EXISTS _migralite ( id TEXT PRIMARY KEY, name TEXT NOT NULL, applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP @@ -159,7 +159,7 @@ export class Migrator { async getAppliedMigrations() { let entries = this.db - .prepare("SELECT id, name, applied_at FROM migrations ORDER BY id ") + .prepare("SELECT id, name, applied_at FROM _migralite ORDER BY id ") .all() as MigrationEntry[]; return entries; }