db: add migrations
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9efe87f125912b03ad7d8cae191fa8596a6a6964
This commit is contained in:
parent
6a73d11c4b
commit
7ff2fd8a93
2 changed files with 24 additions and 0 deletions
12
migrations/postgres/V5__integrity_and_saved_searches.sql
Normal file
12
migrations/postgres/V5__integrity_and_saved_searches.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- Integrity tracking columns
|
||||
ALTER TABLE media_items ADD COLUMN last_verified_at TIMESTAMPTZ;
|
||||
ALTER TABLE media_items ADD COLUMN integrity_status TEXT DEFAULT 'unverified';
|
||||
|
||||
-- Saved searches
|
||||
CREATE TABLE IF NOT EXISTS saved_searches (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
query TEXT NOT NULL,
|
||||
sort_order TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
12
migrations/sqlite/V5__integrity_and_saved_searches.sql
Normal file
12
migrations/sqlite/V5__integrity_and_saved_searches.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- Integrity tracking columns
|
||||
ALTER TABLE media_items ADD COLUMN last_verified_at TEXT;
|
||||
ALTER TABLE media_items ADD COLUMN integrity_status TEXT DEFAULT 'unverified';
|
||||
|
||||
-- Saved searches
|
||||
CREATE TABLE IF NOT EXISTS saved_searches (
|
||||
id TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
query TEXT NOT NULL,
|
||||
sort_order TEXT,
|
||||
created_at TEXT NOT NULL
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue