Skip to content

Commit ad940fb

Browse files
committed
fix: small fixes
Signed-off-by: Uroš Marolt <[email protected]>
1 parent 1266f6b commit ad940fb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

backend/src/database/migrations/V1771839722__refactorIntegrationsTable.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CREATE TABLE integration.nango_mapping (
2626
FOREIGN KEY ("repositoryId") REFERENCES repositories(id) ON DELETE SET NULL
2727
);
2828

29-
CREATE INDEX ix_nango_mapping_connectionId ON integration.nango_mapping ("connectionId");
29+
CREATE UNIQUE INDEX ix_nango_mapping_connectionId ON integration.nango_mapping ("connectionId");
3030
CREATE INDEX ix_nango_mapping_repositoryId ON integration.nango_mapping ("repositoryId");
3131

3232
-- Migrate existing data from settings.nangoMapping
@@ -48,7 +48,8 @@ WHERE i.platform = 'github-nango'
4848
AND i.settings->'nangoMapping' IS NOT NULL
4949
ON CONFLICT DO NOTHING;
5050

51-
-- Remove nangoMapping from settings
51+
-- Remove nangoMapping from settings (only github-nango integrations ever stored this key)
5252
UPDATE integrations
5353
SET settings = settings - 'nangoMapping'
54-
WHERE settings->'nangoMapping' IS NOT NULL;
54+
WHERE platform = 'github-nango'
55+
AND settings->'nangoMapping' IS NOT NULL;

0 commit comments

Comments
 (0)