mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
* Migrating Fredy from LowDb to SqLite 🎉
* adding new sql migration system for future sql migrations
* adding setting to change sqlite path for db files
* create migration plan for graceful migration lowdb -> sqlite
* Improving Documentation
* adding test for sqliteconnection
* upgrading dependencies
* making nodejs 22 as min version
* improve scraper
* adding overwrite ability for db migra
17 lines
505 B
JavaScript
17 lines
505 B
JavaScript
// Initial migration: creates schema_migrations table used by the migration runner.
|
|
//
|
|
export function up(db) {
|
|
db.exec(`
|
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
name TEXT NOT NULL UNIQUE,
|
|
checksum TEXT NOT NULL,
|
|
applied_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
duration_ms INTEGER NOT NULL DEFAULT 0
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_schema_migrations_applied_at
|
|
ON schema_migrations(applied_at);
|
|
`);
|
|
}
|