· 7 years ago · Sep 10, 2018, 02:56 PM
1--
2-- You will see several spelling errors.
3-- These are intentional. Whichever language you speak/use always make spelling mistakes!!
4--
5
6CREATE DATABASE IF NOT EXISTS `8dCXCpnx!UT8U+dO=2` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
7USE `8dCXCpnx!UT8U+dO=2`;
8
9-- Table structure for table `administators`
10-- The Admin password is 7648edd7ddbd1ce2
11
12CREATE TABLE `administators` (
13 `id` int(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
14 `first_name` varchar(32) NOT NULL,
15 `last_name` varchar(32) NOT NULL,
16 `adminame` varchar(56) NOT NULL,
17 `login_id` varchar(56) NOT NULL,
18 `password` varchar(256) NOT NULL,
19 `lader` tinyint(2) NOT NULL DEFAULT '0' COMMENT '0-pending,1-verified,4-comment,5-blog,6-article,7-editor,8-manager,9-owner,11-me',
20 `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
21 `created_by` varchar(56) DEFAULT NULL,
22 `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
23 `modified_by` varchar(56) DEFAULT NULL,
24 `is_deleted` int(1) NOT NULL DEFAULT '0'
25) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
26
27
28-- Insert your 1st record into the table `administators`
29-- In your insert/update sql you only need the following:
30
31INSERT INTO `administators` ( `first_name`, `last_name`, `adminame`, `login_id`, `password`, `lader`) VALUES
32('PeterPaul', 'AndMary', 'puff the magic dragon', '69f866138a3d5fb8', '$2y$10$EYncwRxhA/SAO1PGo/Q6tewXjAa6hWkgGkiZDPYZbw9uERlpTHYYm', 11);
33
34
35-- Create view `admins`
36-- A view is ONLY to view records - never to modify them.
37
38CREATE VIEW `admins` AS SELECT * FROM `administators` WHERE `lader` > 0 and `is_deleted` = 0