File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ CREATE TABLE IF NOT EXISTS convoy.filters (
1515 ON DELETE CASCADE
1616);
1717
18- CREATE INDEX idx_filters_subscription_id ON convoy .filters (subscription_id);
19- CREATE INDEX idx_filters_event_type ON convoy .filters (event_type);
20- CREATE UNIQUE INDEX idx_filters_subscription_event_type ON convoy .filters (subscription_id, event_type);
18+ CREATE INDEX IF NOT EXISTS idx_filters_subscription_id ON convoy .filters (subscription_id);
19+ CREATE INDEX IF NOT EXISTS idx_filters_event_type ON convoy .filters (event_type);
20+ CREATE UNIQUE INDEX IF NOT EXISTS idx_filters_subscription_event_type ON convoy .filters (subscription_id, event_type);
2121
2222CREATE EXTENSION IF NOT EXISTS pgcrypto with schema public;
2323CREATE EXTENSION IF NOT EXISTS pgcrypto with schema convoy;
Original file line number Diff line number Diff line change 11-- +migrate Up
2- alter table convoy .event_types add column json_schema jsonb default ' {}' ;
2+ alter table convoy .event_types add column if not exists json_schema jsonb default ' {}' ;
33
44-- +migrate Down
5- alter table convoy .event_types drop column json_schema;
5+ alter table convoy .event_types drop column if exists json_schema;
Original file line number Diff line number Diff line change 11-- +migrate Up
22create type convoy .portal_auth_types as enum (' static_token' , ' refresh_token' );
3- alter table convoy .portal_links add column auth_type convoy .portal_auth_types not null default ' static_token' ;
3+ alter table convoy .portal_links add column if not exists auth_type convoy .portal_auth_types not null default ' static_token' ;
44
55-- Assigns deterministic owner IDs (16-char SHA256 hash) to endpoints based on their associated portal IDs
66with portals_with_ids as (select id, endpoints from convoy .portal_links where length(endpoints) > 0 )
@@ -19,5 +19,5 @@ set auth_type = 'static_token'
1919where deleted_at is null ;
2020
2121-- +migrate Down
22- alter table convoy .portal_links drop column auth_type;
23- drop type convoy .portal_auth_types ;
22+ alter table convoy .portal_links drop column if exists auth_type;
23+ drop type if exists convoy .portal_auth_types ;
You can’t perform that action at this time.
0 commit comments