fix: use regular unique index for MariaDB 10.6 compat (BIT-277)
MariaDB 10.6 does not support functional indexes. Replace the LOWER(email) functional index with a plain unique index on email; case-insensitive uniqueness is enforced at the application layer. Paperclip-Agent: DevOps Engineer (urlKey devops-engineer; id 5d084b36-f38f-42a5-a92a-520005afda4f) Paperclip-Issue: BIT-277 Paperclip-Run: 7cc9257b-0d1a-475b-9133-8d0aa78d0f08 Co-Authored-By: Paperclip <[email protected]>
This commit is contained in:
1 parent
09eef93b34
commit
a9d85a2fec
1 file changed
+3
-1
@@ -15,5 +15,7 @@ CREATE TABLE IF NOT EXISTS admin_users (
|
||||
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
|
||||
);
|
||||
|
||||
-- MariaDB <10.8 does not support functional indexes; enforce case-insensitive uniqueness
|
||||
-- via a regular unique index on the column (app layer normalises email to lowercase on write).
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS admin_users_email_idx
|
||||
ON admin_users ((LOWER(email)));
|
||||
ON admin_users (email);
|
||||
Reference in new issue
Block a user