mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-15 11:11:19 +08:00
update example.sql
This commit is contained in:
@ -41,6 +41,32 @@ INSERT INTO `category` VALUES (1,'test','test','2020-04-13 15:16:25.000000'),(2,
|
||||
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `permission`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `permission`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `permission` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`label` varchar(50) NOT NULL,
|
||||
`model` varchar(50) NOT NULL,
|
||||
`action` smallint NOT NULL COMMENT 'create: 1\ndelete: 2\nupdate: 3\nread: 4',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `permission`
|
||||
--
|
||||
|
||||
LOCK TABLES `permission` WRITE;
|
||||
/*!40000 ALTER TABLE `permission` DISABLE KEYS */;
|
||||
INSERT INTO `permission` VALUES (22,'Delete Category','Category',2),(23,'Update Category','Category',3),(24,'Read Category','Category',4),(25,'Create Product','Product',1),(26,'Delete Product','Product',2),(27,'Update Product','Product',3),(28,'Read Product','Product',4),(29,'Create User','User',1),(30,'Delete User','User',2),(31,'Update User','User',3),(32,'Read User','User',4),(33,'Create Permission','Permission',1),(34,'Delete Permission','Permission',2),(35,'Update Permission','Permission',3),(36,'Read Permission','Permission',4),(37,'Create Role','Role',1),(38,'Delete Role','Role',2),(39,'Update Role','Role',3),(40,'Read Role','Role',4),(41,'Create Category','Category',1);
|
||||
/*!40000 ALTER TABLE `permission` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `product`
|
||||
--
|
||||
@ -99,6 +125,84 @@ INSERT INTO `product_category` VALUES (1,1);
|
||||
/*!40000 ALTER TABLE `product_category` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `role`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `role`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `role` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`label` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `role`
|
||||
--
|
||||
|
||||
LOCK TABLES `role` WRITE;
|
||||
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
|
||||
INSERT INTO `role` VALUES (1,'user');
|
||||
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `role_permission`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `role_permission`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `role_permission` (
|
||||
`role_id` int NOT NULL,
|
||||
`permission_id` int NOT NULL,
|
||||
KEY `role_id` (`role_id`),
|
||||
KEY `permission_id` (`permission_id`),
|
||||
CONSTRAINT `role_permission_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `role_permission_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `role_permission`
|
||||
--
|
||||
|
||||
LOCK TABLES `role_permission` WRITE;
|
||||
/*!40000 ALTER TABLE `role_permission` DISABLE KEYS */;
|
||||
INSERT INTO `role_permission` VALUES (1,28);
|
||||
/*!40000 ALTER TABLE `role_permission` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `role_user`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `role_user`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `role_user` (
|
||||
`role_id` int NOT NULL,
|
||||
`user_id` int NOT NULL,
|
||||
KEY `role_id` (`role_id`),
|
||||
KEY `user_id` (`user_id`),
|
||||
CONSTRAINT `role_user_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `role_user_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `role_user`
|
||||
--
|
||||
|
||||
LOCK TABLES `role_user` WRITE;
|
||||
/*!40000 ALTER TABLE `role_user` DISABLE KEYS */;
|
||||
INSERT INTO `role_user` VALUES (1,7);
|
||||
/*!40000 ALTER TABLE `role_user` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `user`
|
||||
--
|
||||
@ -115,9 +219,10 @@ CREATE TABLE `user` (
|
||||
`avatar` varchar(200) NOT NULL,
|
||||
`intro` longtext NOT NULL,
|
||||
`created_at` datetime(6) NOT NULL,
|
||||
`is_superuser` tinyint(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@ -126,7 +231,7 @@ CREATE TABLE `user` (
|
||||
|
||||
LOCK TABLES `user` WRITE;
|
||||
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
||||
INSERT INTO `user` VALUES (1,'long2ice','$2b$12$CD5ImAgBr7TZpJABxuXASOXz/cAFMIhXsmnZCU.cvo/c.kOOpSkXq','2020-04-13 12:44:06.000000',1,'https://c-ssl.duitang.com/uploads/item/201901/09/20190109072726_aNNZd.thumb.1000_0.jpeg','test','2020-04-13 12:44:14.000000');
|
||||
INSERT INTO `user` VALUES (1,'long2ice','$2b$12$CD5ImAgBr7TZpJABxuXASOXz/cAFMIhXsmnZCU.cvo/c.kOOpSkXq','2020-04-13 12:44:06.000000',1,'https://c-ssl.duitang.com/uploads/item/201901/09/20190109072726_aNNZd.thumb.1000_0.jpeg','test','2020-04-13 12:44:14.000000',1),(7,'test','$2b$12$CD5ImAgBr7TZpJABxuXASOXz/cAFMIhXsmnZCU.cvo/c.kOOpSkXq','2020-04-14 16:54:40.510165',1,'http://localhost:8080/#/rest/User/7/edit','http://localhost:8080/#/rest/User/7/edit','2020-04-14 16:54:40.510555',0);
|
||||
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
@ -139,4 +244,4 @@ UNLOCK TABLES;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2020-04-13 15:27:30
|
||||
-- Dump completed on 2020-04-16 18:50:40
|
||||
|
Reference in New Issue
Block a user