init commit
This commit is contained in:
25
store/migration/sqlite/0.14/00__drop_resource_public_id.sql
Normal file
25
store/migration/sqlite/0.14/00__drop_resource_public_id.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
DROP TABLE IF EXISTS resource_temp;
|
||||
|
||||
CREATE TABLE resource_temp (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
creator_id INTEGER NOT NULL,
|
||||
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
|
||||
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
|
||||
filename TEXT NOT NULL DEFAULT '',
|
||||
blob BLOB DEFAULT NULL,
|
||||
external_link TEXT NOT NULL DEFAULT '',
|
||||
type TEXT NOT NULL DEFAULT '',
|
||||
size INTEGER NOT NULL DEFAULT 0,
|
||||
internal_path TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
resource_temp (id, creator_id, created_ts, updated_ts, filename, blob, external_link, type, size, internal_path)
|
||||
SELECT
|
||||
id, creator_id, created_ts, updated_ts, filename, blob, external_link, type, size, internal_path
|
||||
FROM
|
||||
resource;
|
||||
|
||||
DROP TABLE resource;
|
||||
|
||||
ALTER TABLE resource_temp RENAME TO resource;
|
||||
5
store/migration/sqlite/0.14/01__create_indexes.sql
Normal file
5
store/migration/sqlite/0.14/01__create_indexes.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
CREATE INDEX IF NOT EXISTS idx_user_username ON user (username);
|
||||
CREATE INDEX IF NOT EXISTS idx_memo_creator_id ON memo (creator_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_memo_content ON memo (content);
|
||||
CREATE INDEX IF NOT EXISTS idx_memo_visibility ON memo (visibility);
|
||||
CREATE INDEX IF NOT EXISTS idx_resource_creator_id ON resource (creator_id);
|
||||
Reference in New Issue
Block a user