Skip to content

Commit f7b4941

Browse files
committed
feat: add project table
1 parent 20720ca commit f7b4941

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

server/data/db_schema.sql

+39
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,45 @@ CREATE TABLE `customresponse` (
141141
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
142142
/*!40101 SET character_set_client = @saved_cs_client */;
143143

144+
145+
146+
--
147+
-- Table structure for table `project`
148+
--
149+
150+
DROP TABLE IF EXISTS `project`;
151+
/*!40101 SET @saved_cs_client = @@character_set_client */;
152+
/*!40101 SET character_set_client = utf8 */;
153+
CREATE TABLE `project` (
154+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
155+
`owners` int(11) unsigned DEFAULT NULL,
156+
`name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
157+
`private` int(11) unsigned DEFAULT NULL,
158+
PRIMARY KEY (`id`)
159+
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
160+
/*!40101 SET character_set_client = @saved_cs_client */;
161+
162+
--
163+
-- Table structure for table `project_user`
164+
--
165+
166+
DROP TABLE IF EXISTS `project_user`;
167+
/*!40101 SET @saved_cs_client = @@character_set_client */;
168+
/*!40101 SET character_set_client = utf8 */;
169+
CREATE TABLE `project_user` (
170+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
171+
`project_id` int(11) unsigned DEFAULT NULL,
172+
`user_id` int(11) unsigned DEFAULT NULL,
173+
PRIMARY KEY (`id`),
174+
UNIQUE KEY `UQ_npfgplw1pmx11q8ysjh8t8i5i2r7qk0vdl80wgbq` (`project_id`,`user_id`),
175+
KEY `index_foreignkey_project_user_project` (`project_id`),
176+
KEY `index_foreignkey_project_user_user` (`user_id`),
177+
CONSTRAINT `c_fk_project_user_project_id` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
178+
CONSTRAINT `c_fk_project_user_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
179+
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
180+
/*!40101 SET character_set_client = @saved_cs_client */;
181+
182+
144183
--
145184
-- Table structure for table `department`
146185
--

0 commit comments

Comments
 (0)