init commit
This commit is contained in:
7
store/migration/sqlite/0.24/00__memo.sql
Normal file
7
store/migration/sqlite/0.24/00__memo.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Remove deprecated indexes.
|
||||
DROP INDEX IF EXISTS idx_memo_tags;
|
||||
DROP INDEX IF EXISTS idx_memo_content;
|
||||
DROP INDEX IF EXISTS idx_memo_visibility;
|
||||
|
||||
-- Drop deprecated tags column.
|
||||
ALTER TABLE memo DROP COLUMN tags;
|
||||
11
store/migration/sqlite/0.24/01__memo_pinned.sql
Normal file
11
store/migration/sqlite/0.24/01__memo_pinned.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Add pinned column.
|
||||
ALTER TABLE memo ADD COLUMN pinned INTEGER NOT NULL CHECK (pinned IN (0, 1)) DEFAULT 0;
|
||||
|
||||
-- Update pinned column from memo_organizer.
|
||||
UPDATE memo
|
||||
SET pinned = 1
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM memo_organizer
|
||||
WHERE memo.id = memo_organizer.memo_id AND memo_organizer.pinned = 1
|
||||
);
|
||||
Reference in New Issue
Block a user