32 lines
1.2 KiB
SQL
32 lines
1.2 KiB
SQL
DROP PROCEDURE IF EXISTS add_migration;
|
|
DELIMITER ??
|
|
CREATE PROCEDURE `add_migration`()
|
|
BEGIN
|
|
DECLARE v INT DEFAULT 1;
|
|
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20261003120000');
|
|
IF v = 0 THEN
|
|
CREATE TABLE `launcher_ticket` (
|
|
`account_id` int unsigned NOT NULL,
|
|
`generation_id` binary(16) NOT NULL,
|
|
`srp_salt` binary(32) NOT NULL,
|
|
`srp_verifier` binary(32) NOT NULL,
|
|
`client_build` smallint unsigned NOT NULL,
|
|
`launcher_session_hash` binary(32) NOT NULL,
|
|
`issued_at` datetime(6) NOT NULL,
|
|
`expires_at` datetime(6) NOT NULL,
|
|
`claim_nonce` binary(16) DEFAULT NULL,
|
|
PRIMARY KEY (`account_id`),
|
|
UNIQUE KEY `uk_launcher_ticket_generation` (`generation_id`),
|
|
KEY `idx_launcher_ticket_expiry` (`expires_at`),
|
|
CONSTRAINT `fk_launcher_ticket_account` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
-- Reconnect proofs issued before ticket-only authentication must not survive
|
|
-- the cutover to this realmd build.
|
|
UPDATE `account` SET `sessionkey` = NULL;
|
|
INSERT INTO `migrations` VALUES ('20261003120000');
|
|
END IF;
|
|
END??
|
|
DELIMITER ;
|
|
CALL add_migration();
|
|
DROP PROCEDURE IF EXISTS add_migration;
|