From b396ed407ecd786e5ae60c5aa2236f8e6c14f145 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 21 Apr 2020 09:21:29 -0400 Subject: [PATCH] Change local unique username constraints. --- .../2020-04-21-123957_remove_unique_user_constraints/down.sql | 4 ++++ .../2020-04-21-123957_remove_unique_user_constraints/up.sql | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 server/migrations/2020-04-21-123957_remove_unique_user_constraints/down.sql create mode 100644 server/migrations/2020-04-21-123957_remove_unique_user_constraints/up.sql diff --git a/server/migrations/2020-04-21-123957_remove_unique_user_constraints/down.sql b/server/migrations/2020-04-21-123957_remove_unique_user_constraints/down.sql new file mode 100644 index 000000000..a172581a1 --- /dev/null +++ b/server/migrations/2020-04-21-123957_remove_unique_user_constraints/down.sql @@ -0,0 +1,4 @@ +-- The username index +drop index idx_user_name_lower_actor_id; +create unique index idx_user_name_lower on user_ (lower(name)); + diff --git a/server/migrations/2020-04-21-123957_remove_unique_user_constraints/up.sql b/server/migrations/2020-04-21-123957_remove_unique_user_constraints/up.sql new file mode 100644 index 000000000..969eab0b6 --- /dev/null +++ b/server/migrations/2020-04-21-123957_remove_unique_user_constraints/up.sql @@ -0,0 +1,2 @@ +drop index idx_user_name_lower; +create unique index idx_user_name_lower_actor_id on user_ (lower(name), lower(actor_id));