fix(08-fix): IN-01 document MariaDB-only long-unique HASH index dependency

This commit is contained in:
Lucas Berger
2026-06-11 19:27:11 -04:00
parent 4001cd5b90
commit bf091102f2
@@ -45,6 +45,11 @@ CREATE TABLE `calendars` (
`last_synced_at` timestamp,
`is_shared` boolean NOT NULL DEFAULT false,
CONSTRAINT `calendars_id` PRIMARY KEY(`id`),
-- NOTE (IN-01): UNIQUE(user_id, url) with url varchar(1024)/utf8mb4 is ~4100 bytes,
-- over InnoDB's 3072-byte index-key limit. Succeeds only because MariaDB 11 silently
-- builds over-length UNIQUE constraints as long-unique HASH indexes; this same DDL
-- fails on MySQL 8 or with stricter SQL modes. Engine-pinned to MariaDB (project hard
-- constraint). Already applied on main/production — do not alter.
CONSTRAINT `uniq_calendar_user_url` UNIQUE(`user_id`,`url`)
);
--> statement-breakpoint
@@ -97,6 +102,11 @@ CREATE TABLE `push_subscriptions` (
`created_at` timestamp NOT NULL DEFAULT (now()),
`updated_at` timestamp DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT `push_subscriptions_id` PRIMARY KEY(`id`),
-- NOTE (IN-01): UNIQUE(endpoint) with endpoint varchar(2048)/utf8mb4 is ~8192 bytes,
-- over InnoDB's 3072-byte index-key limit. Succeeds only because MariaDB 11 silently
-- builds over-length UNIQUE constraints as long-unique HASH indexes; this same DDL
-- fails on MySQL 8 or with stricter SQL modes. Engine-pinned to MariaDB (project hard
-- constraint). Already applied on main/production — do not alter.
CONSTRAINT `uniq_push_endpoint` UNIQUE(`endpoint`)
);
--> statement-breakpoint