server settings scheme updated and default lines added

master
Alex 2021-06-06 20:19:25 +02:00
parent 56085c1b17
commit 63a5c877af
1 changed files with 26 additions and 6 deletions

View File

@ -9,7 +9,7 @@
--
CREATE TABLE `users` (
`id` varchar(32) NOT NULL,
`id` CHAR(32) NOT NULL,
`hashtag` varchar(6) NOT NULL,
`name` varchar(30) NOT NULL,
`email` varchar(255) NOT NULL,
@ -28,12 +28,14 @@ CREATE TABLE `users` (
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `pictures`
--
CREATE TABLE `pictures` (
`user_id` varchar(36) NOT NULL,
`user_id` CHAR(36) NOT NULL,
`picture_id` int(11) NOT NULL,
`likes` int(11) DEFAULT 0,
`dislikes` int(11) DEFAULT 0,
@ -42,19 +44,23 @@ CREATE TABLE `pictures` (
`created` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `sessions`
--
CREATE TABLE `sessions` (
`user_id` varchar(32) NOT NULL,
`session_id` varchar(32) NOT NULL,
`user_id` CHAR(32) NOT NULL,
`session_id` CHAR(32) NOT NULL,
`ip` varchar(32) NOT NULL,
`user_agent` varchar(32) NOT NULL,
`last_login` datetime NOT NULL,
`expires` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `server_settings`
--
@ -63,5 +69,19 @@ CREATE TABLE `server_settings` (
`name` varchar(50) NOT NULL,
`value` varchar(50) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`updated_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `server_settings`
--
INSERT INTO `server_settings` (`name`, `value`, `created_at`, `updated_at`) VALUES
('expired_time', '72', '2021-05-28 19:18:12', NULL),
('username_min_len', '3', '2021-06-06 17:27:38', NULL),
('username_max_len', '30', '2021-06-06 17:40:39', NULL),
('email_min_len', '3', '2021-06-06 17:41:01', NULL),
('email_max_len', '255', '2021-06-06 17:41:31', NULL),
('password_min_len', '6', '2021-06-06 17:41:50', NULL),
('password_max_len', '250', '2021-06-06 17:42:01', NULL);
COMMIT;