mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-04 18:53:52 +10:00
Stored resumes, resume versions, letters and letter versions still in the old editor's legacy mode, or carrying legacy style rules with no stylesheet, are converted to Semantic CSS once, right after the SQL migrations, and the result is recorded in a new data_migration table so later starts skip it. Only metadata.stylesheet is rewritten (the rules stay for rollback), a row edited meanwhile is retried on the next start, and a failure leaves the data as it was without stopping the server. The API no longer converts on every read and save. Imports of old Reactive Resume JSON exports convert their legacy rules on the way in.
11 lines
466 B
TypeScript
11 lines
466 B
TypeScript
import * as pg from "drizzle-orm/pg-core";
|
|
|
|
/**
|
|
* Data migrations that run in code at startup, after the SQL migrations (converting stored data needs app code). Each
|
|
* is recorded here once it has finished, so later startups skip it without scanning the tables again.
|
|
*/
|
|
export const dataMigration = pg.pgTable("data_migration", {
|
|
name: pg.text("name").primaryKey(),
|
|
completedAt: pg.timestamp("completed_at", { withTimezone: true }).notNull().defaultNow(),
|
|
});
|