Skip to content

Commit

Permalink
fk
Browse files Browse the repository at this point in the history
  • Loading branch information
dezren39 committed Dec 18, 2023
1 parent 0226d43 commit 4c4949d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- +goose Up
ALTER TABLE nodes
DROP CONSTRAINT IF EXISTS nodes_team_id_fkey, -- Drop existing foreign key constraint
ADD COLUMN IF NOT EXISTS team_id UUID, -- Add the column if it doesn't exist
ADD CONSTRAINT nodes_team_id_fkey FOREIGN KEY (team_id) REFERENCES teams(id); -- Add foreign key constraint

-- +goose Down
ALTER TABLE nodes
DROP CONSTRAINT IF EXISTS nodes_team_id_fkey; -- Drop the foreign key constraint

0 comments on commit 4c4949d

Please sign in to comment.