From dd235590b47a90d70753458ffc7ab61c771f3d9b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Sep 2020 20:29:14 +0200 Subject: [PATCH] fix: migration --- src/Model/Migration.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Migration.hs b/src/Model/Migration.hs index 0d77f6da3..f82b909e2 100644 --- a/src/Model/Migration.hs +++ b/src/Model/Migration.hs @@ -166,6 +166,7 @@ migrateManual = do , ("submission_sheet", "CREATE INDEX submission_sheet ON submission (sheet)" ) , ("submission_edit_submission", "CREATE INDEX submission_edit_submission ON submission_edit (submission)" ) , ("user_ldap_primary_key", "CREATE INDEX user_ldap_primary_key ON \"user\" (ldap_primary_key)" ) + , ("file_content_entry_chunk_hash", "CREATE INDEX file_content_entry_chunk_hash ON \"file_content_entry\" (chunk_hash)" ) ] where addIndex :: Text -> Sql -> Migration @@ -945,7 +946,7 @@ customMigrations = Map.fromListWith (>>) ALTER TABLE file_content_chunk ADD COLUMN content_based boolean NOT NULL DEFAULT false; UPDATE file_content_chunk SET content_based = true WHERE length(content) <= #{fastCDCMinBlockSize chunkingParams}; - CREATE TABLE file_content_entry (hash bytea NOT NULL, ix bigint NOT NULL, chunk_hash bytea NOT NULL); + CREATE TABLE file_content_entry (id bigserial NOT NULL PRIMARY KEY, hash bytea NOT NULL, ix bigint NOT NULL, chunk_hash bytea NOT NULL); INSERT INTO file_content_entry (hash, chunk_hash, ix) (SELECT hash, hash as chunk_hash, 0 as ix FROM file_content_chunk); |] )