refactors, specific day playtime controls
This commit is contained in:
+8
-6
@@ -6,10 +6,12 @@ import * as schema from './schema';
|
||||
const sqlite = new Database('./sqlite.db');
|
||||
export const db = drizzle(sqlite, { schema });
|
||||
|
||||
// Run migrations on startup
|
||||
try {
|
||||
migrate(db, { migrationsFolder: './lib/db/migrations' });
|
||||
console.log('Database migrations completed');
|
||||
} catch (error) {
|
||||
console.error('Database migration failed:', error);
|
||||
// Only run migrations if explicitly requested
|
||||
if (process.env.RUN_MIGRATIONS === 'true') {
|
||||
try {
|
||||
migrate(db, { migrationsFolder: './lib/db/migrations' });
|
||||
console.log('Database migrations completed');
|
||||
} catch (error) {
|
||||
console.error('Database migration failed:', error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user