Skip to content

Commit bc1b892

Browse files
committed
add unique constraint
1 parent 5855d73 commit bc1b892

File tree

1 file changed

+8
-0
lines changed
  • crates/kitsune-db/migrations/2023-12-16-192941_initial

1 file changed

+8
-0
lines changed

crates/kitsune-db/migrations/2023-12-16-192941_initial/up.sql

+8
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,14 @@ CREATE TABLE roles
636636
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
637637
);
638638

639+
-- UNIQUE constraints
640+
641+
ALTER TABLE roles
642+
ADD CONSTRAINT "uk-roles-name"
643+
UNIQUE (name);
644+
645+
-- Register triggers
646+
639647
SELECT diesel_manage_updated_at('roles');
640648

641649
-- END "roles" TABLE

0 commit comments

Comments
 (0)