diff --git a/api/database/migrations/2026_05_08_100006_create_artist_engagements_table.php b/api/database/migrations/2026_05_08_100006_create_artist_engagements_table.php index 7d8c9d58..977f9448 100644 --- a/api/database/migrations/2026_05_08_100006_create_artist_engagements_table.php +++ b/api/database/migrations/2026_05_08_100006_create_artist_engagements_table.php @@ -44,8 +44,11 @@ return new class extends Migration $table->datetime('advance_open_from')->nullable(); $table->datetime('advance_open_to')->nullable(); - // Portal access - $table->ulid('portal_token')->nullable()->unique(); + // Portal access. Stored as hashed token (sha256 hex, 64 chars). + // RFC v0.2 ยง5.3 says "ULID unique nullable"; in practice the + // PortalTokenController hashes the plain token and stores the + // 64-char hex digest. Widen the column to fit. + $table->string('portal_token', 64)->nullable()->unique(); // Advancing aggregates (recomputed in Session 3) $table->integer('advancing_completed_count')->default(0); diff --git a/api/database/schema/mysql-schema.sql b/api/database/schema/mysql-schema.sql index 41f58fae..fcc343e0 100644 --- a/api/database/schema/mysql-schema.sql +++ b/api/database/schema/mysql-schema.sql @@ -121,7 +121,7 @@ CREATE TABLE `artist_engagements` ( `option_expires_at` datetime DEFAULT NULL, `advance_open_from` datetime DEFAULT NULL, `advance_open_to` datetime DEFAULT NULL, - `portal_token` char(26) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `portal_token` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `advancing_completed_count` int NOT NULL DEFAULT '0', `advancing_total_count` int NOT NULL DEFAULT '0', `notes` text COLLATE utf8mb4_unicode_ci, @@ -1934,13 +1934,13 @@ INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (122,'2026_04_28_14 INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (123,'2026_04_28_180000_create_form_submission_action_failure_retry_attempts_table',1); INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (124,'2026_04_28_181000_add_exception_trace_to_form_submission_action_failures',1); INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (125,'2026_05_08_000001_add_failure_response_code_to_form_submissions',1); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (136,'2026_05_08_100000_create_genres_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (137,'2026_05_08_100001_create_artists_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (138,'2026_05_08_100002_add_handles_buma_to_companies_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (139,'2026_05_08_100003_create_artist_contacts_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (140,'2026_05_08_100004_create_stages_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (141,'2026_05_08_100005_create_stage_days_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (142,'2026_05_08_100006_create_artist_engagements_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (143,'2026_05_08_100007_create_performances_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (144,'2026_05_08_100008_create_advance_sections_table',2); -INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (145,'2026_05_08_100009_create_advance_submissions_table',2); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (126,'2026_05_08_100000_create_genres_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (127,'2026_05_08_100001_create_artists_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (128,'2026_05_08_100002_add_handles_buma_to_companies_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (129,'2026_05_08_100003_create_artist_contacts_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (130,'2026_05_08_100004_create_stages_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (131,'2026_05_08_100005_create_stage_days_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (132,'2026_05_08_100006_create_artist_engagements_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (133,'2026_05_08_100007_create_performances_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (134,'2026_05_08_100008_create_advance_sections_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (135,'2026_05_08_100009_create_advance_submissions_table',1);