Skip to content

Commit 2ab9127

Browse files
committed
feat: db migrations to change repoId reference from githubRepos to git.repositories
1 parent d652882 commit 2ab9127

4 files changed

Lines changed: 17 additions & 0 deletions

backend/src/database/migrations/U1762877932__removeGithubReposReferenceFromMaintainers.sql

Whitespace-only changes.

backend/src/database/migrations/U1762878126__referenceGitRepositoriesInMaintainers.sql

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Migration to remove the foreign key constraint from maintainersInternal.repoId to githubRepos.id
2+
-- This removes the dependency on githubRepos table
3+
-- The new foreign key to git.repositories.id will be added in the referenceGitRepositoriesInMaintainers migration
4+
5+
ALTER TABLE "maintainersInternal"
6+
DROP CONSTRAINT IF EXISTS "maintainersInternal_repoId_fkey";
7+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Migration to add foreign key constraint from maintainersInternal.repoId to git.repositories.id
2+
-- This creates the new reference to git.repositories table
3+
-- The old reference to githubRepos.id should have been removed in the removeGithubReposReferenceFromMaintainers migration
4+
5+
ALTER TABLE "maintainersInternal"
6+
ADD CONSTRAINT "maintainersInternal_repoId_fkey"
7+
FOREIGN KEY ("repoId")
8+
REFERENCES git.repositories(id)
9+
ON DELETE CASCADE;
10+

0 commit comments

Comments
 (0)