diff --git a/core/migrations/000000_base.sql b/core/migrations/000000_base.sql index 8286c4d..ab01302 100644 --- a/core/migrations/000000_base.sql +++ b/core/migrations/000000_base.sql @@ -1,5 +1,5 @@ -- Таблица versions -- -create table if not exists `migrations` ( +create table if not exists `d_migrations` ( `id` int(10) unsigned not null auto_increment, `name` varchar(255) not null, `date_created` timestamp default current_timestamp, diff --git a/core/migrations/000001_core.sql b/core/migrations/000001_core.sql index 81fa1f2..95ae47d 100644 --- a/core/migrations/000001_core.sql +++ b/core/migrations/000001_core.sql @@ -1,4 +1,4 @@ -CREATE TABLE `users` +CREATE TABLE `d_users` ( `id` int(11) NOT NULL, `login` varchar(100) NOT NULL, @@ -10,16 +10,16 @@ CREATE TABLE `users` `last_active` varchar(100) NOT NULL, `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_updated` datetime DEFAULT NULL -) ENGINE = MyISAM +) ENGINE = innodb DEFAULT CHARSET = utf8; -INSERT INTO `users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) -VALUES (1, 'admin', '5321ef98bd96cccf03f50979fdd8c893', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', +INSERT INTO `d_users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) +VALUES (1, 'admin', '7c607172d24d7237579acfdeffe373e2', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', '1657051585', '2022-06-17 16:18:56', NULL), - (2, 'a.kirilcev', 'c7e82c3d2bed998ea1f4c1aca09c282b', 'Александр Кирильцев', 'a.kirilcev@it-tula.ru', 20, + (2, 'demo', '7c607172d24d7237579acfdeffe373e2', 'Demo', 'demo@it-stories.ru', 20, 'RG17DE-1000-26FC-837F-8F9C47E643970', '1655471459', '2022-06-17 16:18:56', NULL), (3, 'system', '', 'Система', 'info@it-stories.ru', NULL, 'RG17DE-1000-2702-816F-97E3877DD6650', '1651673702', '2022-06-17 16:18:56', NULL); -ALTER TABLE `users` ADD PRIMARY KEY (`id`); -ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 25; +ALTER TABLE `d_users` ADD PRIMARY KEY (`id`); +ALTER TABLE `d_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 25; CREATE TABLE `roles` ( diff --git a/core/migrations/000002_users.sql b/core/migrations/000002_users.sql index 6950284..56f8b71 100644 --- a/core/migrations/000002_users.sql +++ b/core/migrations/000002_users.sql @@ -1,4 +1,4 @@ -CREATE TABLE if not exists `users` +CREATE TABLE if not exists `d_users` ( `id` int(11) NOT NULL, `login` varchar(100) NOT NULL, @@ -10,20 +10,20 @@ CREATE TABLE if not exists `users` `last_active` varchar(100) NOT NULL, `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_updated` datetime DEFAULT NULL -) ENGINE = MyISAM +) ENGINE = innodb DEFAULT CHARSET = utf8; -INSERT INTO `users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) -VALUES (1, 'admin', '5321ef98bd96cccf03f50979fdd8c893', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', +INSERT INTO `d_users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) +VALUES (1, 'admin', '7c607172d24d7237579acfdeffe373e2', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', '1657051585', '2022-06-17 16:18:56', NULL), - (2, 'a.kirilcev', 'c7e82c3d2bed998ea1f4c1aca09c282b', 'Александр Кирильцев', 'a.kirilcev@it-tula.ru', 20, + (2, 'demo', '7c607172d24d7237579acfdeffe373e2', 'Demo user', 'demo@it-stories.ru', 20, 'RG17DE-1000-26FC-837F-8F9C47E643970', '1655471459', '2022-06-17 16:18:56', NULL), (3, 'system', '', 'Система', 'info@it-stories.ru', NULL, 'RG17DE-1000-2702-816F-97E3877DD6650', '1651673702', '2022-06-17 16:18:56', NULL); -ALTER TABLE `users` +ALTER TABLE `d_users` ADD PRIMARY KEY (`id`); -ALTER TABLE `users` +ALTER TABLE `d_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 25; COMMIT; \ No newline at end of file diff --git a/core/migrations/000003_roles.sql b/core/migrations/000003_roles.sql index 6a501a7..66f5755 100644 --- a/core/migrations/000003_roles.sql +++ b/core/migrations/000003_roles.sql @@ -1,12 +1,12 @@ -CREATE TABLE if not exists `roles` ( +CREATE TABLE if not exists `d_roles` ( `id` int(11) NOT NULL, `name` text, `description` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=innodb DEFAULT CHARSET=utf8; -INSERT INTO `roles` (`id`, `name`, `description`) VALUES +INSERT INTO `d_roles` (`id`, `name`, `description`) VALUES (1, 'Админисистратор', 'Группа, имеющая доступ ко всему'), (2, 'Пользователи', 'Базовая группа для простых пользователей'), -ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); \ No newline at end of file +ALTER TABLE `d_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); \ No newline at end of file diff --git a/core/migrations/000004_user_roles.sql b/core/migrations/000004_user_roles.sql index 450e427..52ab864 100644 --- a/core/migrations/000004_user_roles.sql +++ b/core/migrations/000004_user_roles.sql @@ -1,9 +1,9 @@ -CREATE TABLE if not exists `user_roles` ( +CREATE TABLE if not exists `d_user_roles` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `role_id` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=innodb DEFAULT CHARSET=utf8; -INSERT INTO `user_roles` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1), -ALTER TABLE `user_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `user_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; \ No newline at end of file +INSERT INTO `d_user_roles` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1), +ALTER TABLE `d_user_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); +ALTER TABLE `d_user_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; \ No newline at end of file diff --git a/core/migrations/000005_files.sql b/core/migrations/000005_files.sql index 52ca07e..5886717 100644 --- a/core/migrations/000005_files.sql +++ b/core/migrations/000005_files.sql @@ -1,7 +1,7 @@ -CREATE TABLE if not exists `files` ( +CREATE TABLE if not exists `d_files` ( `id` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `path` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `files` ADD PRIMARY KEY (`id`); -ALTER TABLE `files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; \ No newline at end of file +) ENGINE=innodb DEFAULT CHARSET=utf8; +ALTER TABLE `d_files` ADD PRIMARY KEY (`id`); +ALTER TABLE `d_files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; \ No newline at end of file diff --git a/core/migrations/000006_threads.sql b/core/migrations/000006_threads.sql index aa19292..26846cf 100644 --- a/core/migrations/000006_threads.sql +++ b/core/migrations/000006_threads.sql @@ -1,4 +1,4 @@ -CREATE TABLE `threads` ( +CREATE TABLE `d_threads` ( `id` int(11) NOT NULL, `active` varchar(1) NOT NULL DEFAULT 'N', `in_progress` varchar(1) NOT NULL DEFAULT 'N', @@ -13,6 +13,6 @@ CREATE TABLE `threads` ( `params` text, `status` varchar(255) DEFAULT NULL, `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989; \ No newline at end of file +) ENGINE=innodb DEFAULT CHARSET=utf8; +ALTER TABLE `d_threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); +ALTER TABLE `d_threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989; \ No newline at end of file diff --git a/core/migrations/000007_threads_history.sql b/core/migrations/000007_threads_history.sql index d0c80e1..7c44620 100644 --- a/core/migrations/000007_threads_history.sql +++ b/core/migrations/000007_threads_history.sql @@ -1,4 +1,4 @@ -CREATE TABLE if not exists `threads_history` ( +CREATE TABLE if not exists `d_threads_history` ( `id` int(11) NOT NULL, `task_id` int(11) DEFAULT NULL, `execution_time` varchar(255) DEFAULT NULL, @@ -10,6 +10,6 @@ CREATE TABLE if not exists `threads_history` ( `params` text, `status` varchar(255) DEFAULT NULL, `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `threads_history` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `threads_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7946; \ No newline at end of file +) ENGINE=innodb DEFAULT CHARSET=utf8; +ALTER TABLE `d_threads_history` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); +ALTER TABLE `d_threads_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7946; \ No newline at end of file