-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new column for builtin_actor_events (#1290)
* Add new column for builtin_actor_events: eventIdx * fix the logger name to builtinactorevents
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package v1 | ||
|
||
func init() { | ||
patches.Register( | ||
37, | ||
` | ||
ALTER TABLE {{ .SchemaName | default "public"}}.builtin_actor_events ADD COLUMN IF NOT EXISTS "event_idx" BIGINT DEFAULT 0; | ||
ALTER TABLE {{ .SchemaName | default "public"}}.builtin_actor_events DROP CONSTRAINT IF EXISTS builtin_actor_events_pkey CASCADE, ADD PRIMARY KEY(height, cid, emitter, event_type, event_idx); | ||
CREATE INDEX IF NOT EXISTS builtin_actor_events_emitter_idx ON {{ .SchemaName | default "public"}}.builtin_actor_events USING hash (emitter); | ||
CREATE INDEX IF NOT EXISTS builtin_actor_events_event_type_idx ON {{ .SchemaName | default "public"}}.builtin_actor_events USING hash (event_type); | ||
CREATE INDEX IF NOT EXISTS builtin_actor_events_height_idx ON {{ .SchemaName | default "public"}}.builtin_actor_events USING btree (height); | ||
SELECT create_hypertable( | ||
'builtin_actor_events', | ||
'height', | ||
chunk_time_interval => 2880, | ||
if_not_exists => TRUE, | ||
migrate_data => TRUE | ||
); | ||
SELECT set_integer_now_func('builtin_actor_events', 'current_height', replace_if_exists => true); | ||
`, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters