-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheventdb.sql
More file actions
117 lines (107 loc) · 5.72 KB
/
Copy patheventdb.sql
File metadata and controls
117 lines (107 loc) · 5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
Navicat Premium Dump SQL
Source Server : localhost_3306_1
Source Server Type : MySQL
Source Server Version : 90500 (9.5.0)
Source Host : localhost:3306
Source Schema : eventdb
Target Server Type : MySQL
Target Server Version : 90500 (9.5.0)
File Encoding : 65001
Date: 29/11/2025 00:37:22
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for attachments
-- ----------------------------
DROP TABLE IF EXISTS `attachments`;
CREATE TABLE `attachments` (
`id` int NOT NULL AUTO_INCREMENT,
`uploadedByUid` int NOT NULL,
`projectId` int NULL DEFAULT NULL,
`registrationId` int NULL DEFAULT NULL,
`url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`originalFilename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`mimeType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`createdAt` datetime NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `ix_attachments_uploadedByUid`(`uploadedByUid` ASC) USING BTREE,
INDEX `ix_attachments_projectId`(`projectId` ASC) USING BTREE,
INDEX `ix_attachments_registrationId`(`registrationId` ASC) USING BTREE,
CONSTRAINT `attachments_ibfk_1` FOREIGN KEY (`uploadedByUid`) REFERENCES `users` (`uid`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `attachments_ibfk_2` FOREIGN KEY (`projectId`) REFERENCES `projects` (`projectId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `attachments_ibfk_3` FOREIGN KEY (`registrationId`) REFERENCES `registrations` (`registrationId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for projects
-- ----------------------------
DROP TABLE IF EXISTS `projects`;
CREATE TABLE `projects` (
`projectId` int NOT NULL AUTO_INCREMENT,
`uid` int NOT NULL,
`title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`repoUrl` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`demoUrl` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
PRIMARY KEY (`projectId`) USING BTREE,
INDEX `ix_projects_uid`(`uid` ASC) USING BTREE,
INDEX `ix_projects_projectId`(`projectId` ASC) USING BTREE,
INDEX `ix_project_user_created`(`uid` ASC, `createdAt` ASC) USING BTREE,
CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `users` (`uid`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for registrations
-- ----------------------------
DROP TABLE IF EXISTS `registrations`;
CREATE TABLE `registrations` (
`registrationId` int NOT NULL AUTO_INCREMENT,
`uid` int NOT NULL,
`note` varchar(15000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`createdAt` datetime NOT NULL,
`status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
PRIMARY KEY (`registrationId`) USING BTREE,
INDEX `ix_registrations_uid`(`uid` ASC) USING BTREE,
CONSTRAINT `registrations_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `users` (`uid`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`uid` int NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`passwordHash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`avatarUrl` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`bio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
`phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`isAdmin` tinyint(1) NOT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
PRIMARY KEY (`uid`) USING BTREE,
UNIQUE INDEX `ix_users_username`(`username` ASC) USING BTREE,
UNIQUE INDEX `ix_users_email`(`email` ASC) USING BTREE,
INDEX `ix_users_uid`(`uid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 998641 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for verification_codes
-- ----------------------------
DROP TABLE IF EXISTS `verification_codes`;
CREATE TABLE `verification_codes` (
`id` int NOT NULL AUTO_INCREMENT,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`code` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`expires_at` datetime NOT NULL,
`last_send_at` datetime NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uq_vcode_email`(`email` ASC, `type` ASC) USING BTREE,
INDEX `ix_verification_codes_email`(`email` ASC) USING BTREE,
INDEX `ix_verification_codes_type`(`type` ASC) USING BTREE,
INDEX `ix_verification_codes_expires_at`(`expires_at` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 190 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;