1- /*
2- Navicat MySQL Data Transfer
3-
4- Source Server : localhost_3306
5- Source Server Version : 50505
6- Source Host : localhost:3306
7- Source Database : webdev
8-
9- Target Server Type : MYSQL
10- Target Server Version : 50505
11- File Encoding : 65001
12-
13- Date: 2023-07-31 03:02:15
14- */
151
162SET FOREIGN_KEY_CHECKS= 0 ;
17- -- ----------------------------
18- -- Table structure for `active_users`
19- -- ----------------------------
20- DROP TABLE IF EXISTS ` active_users` ;
21- CREATE TABLE `active_users ` (
22- ` count` int (11 ) NOT NULL DEFAULT 0
23- ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
24-
25- -- ----------------------------
26- -- Records of active_users
27- -- ----------------------------
28- INSERT INTO ` active_users` VALUES (' 66' );
29-
303-- ----------------------------
314-- Table structure for `chat_messages`
325-- ----------------------------
336DROP TABLE IF EXISTS ` chat_messages` ;
347CREATE TABLE `chat_messages ` (
35- ` id` int (11 ) NOT NULL ,
8+ ` id` int (11 ) NOT NULL AUTO_INCREMENT ,
369 ` username` varchar (255 ) NOT NULL ,
3710 ` avatar_url` varchar (255 ) NOT NULL ,
3811 ` message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
3912 ` timestamp` timestamp NOT NULL DEFAULT current_timestamp (),
40- ` rank` varchar (255 ) NOT NULL DEFAULT ' team'
41- ) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
13+ ` rank` varchar (255 ) NOT NULL DEFAULT ' team' ,
14+ PRIMARY KEY (` id` )
15+ ) ENGINE= InnoDB AUTO_INCREMENT= 147 DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
4216
4317
18+ -- ----------------------------
19+ -- Table structure for `online_users`
20+ -- ----------------------------
21+ DROP TABLE IF EXISTS ` online_users` ;
22+ CREATE TABLE `online_users ` (
23+ ` id` int (11 ) NOT NULL AUTO_INCREMENT,
24+ ` username` varchar (255 ) NOT NULL ,
25+ ` avatar_url` varchar (255 ) NOT NULL ,
26+ ` last_seen` timestamp NOT NULL DEFAULT current_timestamp () ON UPDATE current_timestamp (),
27+ PRIMARY KEY (` id` )
28+ ) ENGINE= InnoDB AUTO_INCREMENT= 18 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
29+
4430-- ----------------------------
4531-- Table structure for `security_codes`
4632-- ----------------------------
4733DROP TABLE IF EXISTS ` security_codes` ;
4834CREATE TABLE `security_codes ` (
4935 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
50- ` user_id` int (11 ) DEFAULT NULL ,
51- ` code_hash` varchar (255 ) NOT NULL ,
52- ` is_used` tinyint (1 ) NOT NULL DEFAULT 0 ,
53- PRIMARY KEY (` id` ),
54- KEY ` user_id` (` user_id` ),
55- CONSTRAINT ` security_codes_ibfk_1` FOREIGN KEY (` user_id` ) REFERENCES ` staff_accounts` (` id` )
56- ) ENGINE= InnoDB AUTO_INCREMENT= 7 DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
36+ ` code` varchar (255 ) NOT NULL ,
37+ PRIMARY KEY (` id` )
38+ ) ENGINE= InnoDB AUTO_INCREMENT= 5 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
5739
40+ -- ----------------------------
41+ -- Records of security_codes
42+ -- ----------------------------
43+ INSERT INTO ` security_codes` VALUES (' 1' , ' 123456789' );
44+ INSERT INTO ` security_codes` VALUES (' 2' , ' 123' );
45+ INSERT INTO ` security_codes` VALUES (' 3' , ' 1234' );
46+ INSERT INTO ` security_codes` VALUES (' 4' , ' 12345' );
5847
5948-- ----------------------------
6049-- Table structure for `staff_accounts`
@@ -70,23 +59,7 @@ CREATE TABLE `staff_accounts` (
7059 ` rank` varchar (50 ) NOT NULL DEFAULT ' Supporter' ,
7160 PRIMARY KEY (` id` ),
7261 UNIQUE KEY ` username` (` username` )
73- ) ENGINE= InnoDB AUTO_INCREMENT= 17 DEFAULT CHARSET= latin1 COLLATE= latin1_swedish_ci;
74-
75-
76- -- ----------------------------
77- -- Table structure for `support_tickets`
78- -- ----------------------------
79- DROP TABLE IF EXISTS ` support_tickets` ;
80- CREATE TABLE `support_tickets ` (
81- ` ticket_id` int (11 ) NOT NULL AUTO_INCREMENT,
82- ` username` varchar (255 ) NOT NULL ,
83- ` subject` varchar (255 ) NOT NULL ,
84- ` priority` varchar (20 ) NOT NULL ,
85- ` message` text NOT NULL ,
86- ` status` varchar (20 ) NOT NULL DEFAULT ' Open' ,
87- ` created_at` timestamp NOT NULL DEFAULT current_timestamp (),
88- PRIMARY KEY (` ticket_id` )
89- ) ENGINE= InnoDB AUTO_INCREMENT= 2 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
62+ ) ENGINE= InnoDB AUTO_INCREMENT= 18 DEFAULT CHARSET= latin1 COLLATE= latin1_swedish_ci;
9063
9164-- ----------------------------
9265-- Table structure for `todo_tasks`
@@ -98,53 +71,25 @@ CREATE TABLE `todo_tasks` (
9871 ` completed` tinyint (1 ) NOT NULL DEFAULT 0 ,
9972 ` created_at` timestamp NOT NULL DEFAULT current_timestamp (),
10073 PRIMARY KEY (` id` )
101- ) ENGINE= InnoDB AUTO_INCREMENT= 58 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
102-
103-
104- -- ----------------------------
105- -- Table structure for `user_activity`
106- -- ----------------------------
107- DROP TABLE IF EXISTS ` user_activity` ;
108- CREATE TABLE `user_activity ` (
109- ` id` int (11 ) NOT NULL AUTO_INCREMENT,
110- ` user_id` int (11 ) NOT NULL ,
111- ` activity_description` varchar (255 ) NOT NULL ,
112- ` activity_date` timestamp NOT NULL DEFAULT current_timestamp (),
113- PRIMARY KEY (` id` )
114- ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
115-
74+ ) ENGINE= InnoDB AUTO_INCREMENT= 60 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
11675
11776-- ----------------------------
118- -- Table structure for `users `
77+ -- Table structure for `user_logs `
11978-- ----------------------------
120- DROP TABLE IF EXISTS ` users ` ;
121- CREATE TABLE `users ` (
79+ DROP TABLE IF EXISTS ` user_logs ` ;
80+ CREATE TABLE `user_logs ` (
12281 ` id` int (6 ) unsigned NOT NULL AUTO_INCREMENT,
12382 ` username` varchar (255 ) NOT NULL ,
12483 ` browser` varchar (255 ) NOT NULL ,
12584 ` os` varchar (255 ) NOT NULL ,
12685 ` ip_address` varchar (50 ) NOT NULL ,
127- ` screen_resolution` varchar (50 ) NOT NULL ,
128- ` connection_type` varchar (50 ) NOT NULL ,
12986 ` dnt_header` tinyint (1 ) NOT NULL ,
13087 ` local_storage` varchar (50 ) NOT NULL ,
13188 ` session_storage` varchar (50 ) NOT NULL ,
13289 ` cookies` text NOT NULL ,
133- ` reg_date` timestamp NULL DEFAULT current_timestamp () ON UPDATE current_timestamp (),
90+ ` language` varchar (50 ) NOT NULL ,
91+ ` referrer` varchar (255 ) NOT NULL ,
92+ ` reg_date` timestamp NOT NULL DEFAULT current_timestamp () ON UPDATE current_timestamp (),
13493 PRIMARY KEY (` id` )
135- ) ENGINE= InnoDB AUTO_INCREMENT= 130 DEFAULT CHARSET= latin1 COLLATE= latin1_swedish_ci;
136-
137- -- ----------------------------
138- -- Table structure for `users_online`
139- -- ----------------------------
140- DROP TABLE IF EXISTS ` users_online` ;
141- CREATE TABLE `users_online ` (
142- ` session_id` varchar (255 ) NOT NULL ,
143- ` username` varchar (255 ) NOT NULL ,
144- ` last_activity` timestamp NOT NULL DEFAULT current_timestamp (),
145- PRIMARY KEY (` session_id` )
146- ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
94+ ) ENGINE= InnoDB AUTO_INCREMENT= 41 DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_general_ci;
14795
148- -- ----------------------------
149- -- Records of users_online
150- -- ----------------------------
0 commit comments