mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-07-12 20:16:21 +02:00
Add MySQL schema for new tables 'users_2fa' and 'users_otps'
This commit is contained in:
@ -23,6 +23,17 @@ CREATE TABLE IF NOT EXISTS `users` (
|
|||||||
UNIQUE KEY `email` (`email`)
|
UNIQUE KEY `email` (`email`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `users_2fa` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` int(10) unsigned NOT NULL,
|
||||||
|
`mechanism` tinyint(2) unsigned NOT NULL,
|
||||||
|
`seed` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`created_at` int(10) unsigned NOT NULL,
|
||||||
|
`expires_at` int(10) unsigned DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `user_id_mechanism` (`user_id`,`mechanism`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `users_confirmations` (
|
CREATE TABLE IF NOT EXISTS `users_confirmations` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` int(10) unsigned NOT NULL,
|
`user_id` int(10) unsigned NOT NULL,
|
||||||
@ -36,6 +47,19 @@ CREATE TABLE IF NOT EXISTS `users_confirmations` (
|
|||||||
KEY `user_id` (`user_id`)
|
KEY `user_id` (`user_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `users_otps` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` int(10) unsigned NOT NULL,
|
||||||
|
`mechanism` tinyint(2) unsigned NOT NULL,
|
||||||
|
`single_factor` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`selector` varchar(24) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
|
||||||
|
`token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
|
||||||
|
`expires_at` int(10) unsigned DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `user_id_mechanism` (`user_id`,`mechanism`),
|
||||||
|
KEY `selector_user_id` (`selector`,`user_id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `users_remembered` (
|
CREATE TABLE IF NOT EXISTS `users_remembered` (
|
||||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`user` int(10) unsigned NOT NULL,
|
`user` int(10) unsigned NOT NULL,
|
||||||
|
Reference in New Issue
Block a user