github.com/icyphox/x@v0.0.355-0.20220311094250-029bd783e8b8/popx/stub/migrations/legacy/20200830154602_add_verification_token.mysql.up.sql (about) 1 CREATE TABLE `identity_verification_tokens` ( 2 `id` char(36) NOT NULL, 3 PRIMARY KEY(`id`), 4 `token` VARCHAR (64) NOT NULL, 5 `used` bool NOT NULL DEFAULT false, 6 `used_at` DATETIME, 7 `expires_at` DATETIME NOT NULL, 8 `issued_at` DATETIME NOT NULL, 9 `identity_verifiable_address_id` char(36) NOT NULL, 10 `selfservice_verification_flow_id` char(36), 11 `created_at` DATETIME NOT NULL, 12 `updated_at` DATETIME NOT NULL, 13 FOREIGN KEY (`identity_verifiable_address_id`) REFERENCES `identity_verifiable_addresses` (`id`) ON DELETE cascade, 14 FOREIGN KEY (`selfservice_verification_flow_id`) REFERENCES `selfservice_verification_flows` (`id`) ON DELETE cascade 15 ) ENGINE=InnoDB; 16 CREATE UNIQUE INDEX `identity_verification_tokens_token_uq_idx` ON `identity_verification_tokens` (`token`); 17 CREATE INDEX `identity_verification_tokens_token_idx` ON `identity_verification_tokens` (`token`); 18 CREATE INDEX `identity_verification_tokens_verifiable_address_id_idx` ON `identity_verification_tokens` (`identity_verifiable_address_id`); 19 CREATE INDEX `identity_verification_tokens_verification_flow_id_idx` ON `identity_verification_tokens` (`selfservice_verification_flow_id`);