Skip to content

Commit

Permalink
db_connector: add constraint to allowed_users table that requires eac…
Browse files Browse the repository at this point in the history
…h combination of user_id and charger_id to be unique.
  • Loading branch information
ffreddow committed Dec 12, 2024
1 parent a51f7c5 commit 1fb85e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
ALTER TABLE "allowed_users" DROP CONSTRAINT "user_id_charger_id";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Your SQL goes here

ALTER TABLE "allowed_users" ADD CONSTRAINT "user_id_charger_id" UNIQUE ("user_id", "charger_id");

0 comments on commit 1fb85e0

Please sign in to comment.