Skip to content

Commit

Permalink
Merge pull request #217 from nightly-labs/database_fixed
Browse files Browse the repository at this point in the history
database fixed
  • Loading branch information
dzlk17 authored Oct 17, 2024
2 parents 97d8f24 + d911280 commit af32303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions database/migrations/0002_team.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CREATE TABLE team(
subscription subscription,
team_admin_id TEXT NOT NULL,
registration_timestamp TIMESTAMPTZ NOT NULL,
deactivated_at TIMESTAMPTZ,
PRIMARY KEY (team_name, team_admin_id)
);
deactivated_at TIMESTAMPTZ
);

CREATE UNIQUE INDEX unique_active_team_name
ON team (team_admin_id, team_name)
WHERE deactivated_at IS NULL;
4 changes: 3 additions & 1 deletion database/migrations/0004_registered_apps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ CREATE TABLE registered_apps(
deactivated_at TIMESTAMPTZ
);

CREATE UNIQUE INDEX app_id_idx ON registered_apps(app_id);
CREATE UNIQUE INDEX unique_active_app_name
ON registered_apps (team_id, app_name)
WHERE deactivated_at IS NULL;

0 comments on commit af32303

Please sign in to comment.