Skip to content

Commit

Permalink
fix period migration
Browse files Browse the repository at this point in the history
- fix the pseudo migration that adds periods -- nobody outside of dev would have had the unit column :)
  • Loading branch information
cloverich committed Oct 4, 2020
1 parent 6134de9 commit 06385ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/api/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export async function recreateSchema(db: Database, reschema: boolean) {
// I don't have migrations yet. Or users. Do this for now,
// delete this later. Add real migrations.
try {
db.exec("ALTER TABLE journals RENAME unit TO period");
db.exec(
`ALTER TABLE journals ADD COLUMN period TEXT NOT NULL DEFAULT "day"`
);
} catch (err) {}

db.exec(`CREATE TABLE IF NOT EXISTS journals (
Expand Down

0 comments on commit 06385ef

Please sign in to comment.