CREATE TABLE account.`userRole` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`userFk` int(10) unsigned NOT NULL,
	`roleFk` int(10) unsigned NOT NULL,
	`hasGrant` tinyint(1) NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`),
	KEY `userRole_user_FK` (`userFk`),
	KEY `userRole_role_FK` (`roleFk`),
	CONSTRAINT `userRole_role_FK` FOREIGN KEY (`roleFk`) REFERENCES `role` (`id`) ON UPDATE CASCADE,
	CONSTRAINT `userRole_user_FK` FOREIGN KEY (`userFk`) REFERENCES `user` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

ALTER TABLE account.`user` CHANGE `role` role__ int(10) unsigned DEFAULT 2 NOT NULL COMMENT '@deprecated 2025-01-07';
