Skip to content

Commit 5b9429d

Browse files
authored
update sql files (#2419)
1 parent 4f7c134 commit 5b9429d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sql/1740483415.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

2222
CREATE EXTENSION IF NOT EXISTS pgcrypto with schema public;
2323
CREATE EXTENSION IF NOT EXISTS pgcrypto with schema convoy;

sql/1742902597.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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;

sql/1756132551.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- +migrate Up
22
create 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
66
with portals_with_ids as (select id, endpoints from convoy.portal_links where length(endpoints) > 0)
@@ -19,5 +19,5 @@ set auth_type = 'static_token'
1919
where 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;

0 commit comments

Comments
 (0)