From 73e7036cf1d595b3076977b2f3cb1b16b2b235a1 Mon Sep 17 00:00:00 2001 From: "terry.hung" Date: Wed, 18 Oct 2023 16:25:39 +0800 Subject: [PATCH] hot fix migration script (#1272) --- schemas/v1/35_add_pkey_for_tables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/v1/35_add_pkey_for_tables.go b/schemas/v1/35_add_pkey_for_tables.go index b5d250f5..1827528d 100644 --- a/schemas/v1/35_add_pkey_for_tables.go +++ b/schemas/v1/35_add_pkey_for_tables.go @@ -6,7 +6,7 @@ func init() { ` ALTER TABLE {{ .SchemaName | default "public"}}.drand_block_entries DROP CONSTRAINT IF EXISTS drand_block_entries_pkey CASCADE, ADD PRIMARY KEY (round, block); ALTER TABLE {{ .SchemaName | default "public"}}.vm_messages DROP CONSTRAINT IF EXISTS vm_messages_pkey CASCADE, ADD PRIMARY KEY(height, state_root, cid, source, index); - ALTER TABLE {{ .SchemaName | default "public"}}.actor_events ADD COLUMN IF NOT EXISTS entry_index bigint; + ALTER TABLE {{ .SchemaName | default "public"}}.actor_events ADD COLUMN IF NOT EXISTS entry_index bigint DEFAULT 0; ALTER TABLE {{ .SchemaName | default "public"}}.actor_events DROP CONSTRAINT IF EXISTS actor_events_pkey CASCADE, ADD PRIMARY KEY(height, state_root, message_cid, event_index, entry_index); ALTER TABLE {{ .SchemaName | default "public"}}.actor_states ADD COLUMN IF NOT EXISTS address text DEFAULT ''; ALTER TABLE {{ .SchemaName | default "public"}}.actor_states DROP CONSTRAINT IF EXISTS actor_states_pkey CASCADE, ADD PRIMARY KEY(height, head, code, address);