提交 d3c62225 编写于 作者: M Mars Liu

init databaase script

上级 34e7a5bc
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
-- Current Database: `goods` -- Current Database: `goods`
-- --
USE `goods`;
-- --
-- Table structure for table `bids` -- Table structure for table `bids`
...@@ -33,7 +32,7 @@ CREATE TABLE `bids` ( ...@@ -33,7 +32,7 @@ CREATE TABLE `bids` (
`invitation_id` int DEFAULT NULL, `invitation_id` int DEFAULT NULL,
`company_id` int DEFAULT NULL, `company_id` int DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -62,7 +61,7 @@ CREATE TABLE `book` ( ...@@ -62,7 +61,7 @@ CREATE TABLE `book` (
`publish_at` date NOT NULL, `publish_at` date NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `idx_book_isbn` (`isbn`) UNIQUE KEY `idx_book_isbn` (`isbn`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -86,7 +85,7 @@ CREATE TABLE `company` ( ...@@ -86,7 +85,7 @@ CREATE TABLE `company` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`name` varchar(256) DEFAULT NULL, `name` varchar(256) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -112,7 +111,7 @@ CREATE TABLE `customer` ( ...@@ -112,7 +111,7 @@ CREATE TABLE `customer` (
`address` varchar(1024) DEFAULT NULL, `address` varchar(1024) DEFAULT NULL,
`level` int DEFAULT NULL, `level` int DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -141,7 +140,7 @@ CREATE TABLE `employee` ( ...@@ -141,7 +140,7 @@ CREATE TABLE `employee` (
`post` varchar(256) DEFAULT NULL, `post` varchar(256) DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`) UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -170,7 +169,7 @@ CREATE TABLE `goods` ( ...@@ -170,7 +169,7 @@ CREATE TABLE `goods` (
`stock-id` int DEFAULT NULL, `stock-id` int DEFAULT NULL,
`upper_time` timestamp NULL DEFAULT NULL, `upper_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -194,7 +193,7 @@ CREATE TABLE `goods_category` ( ...@@ -194,7 +193,7 @@ CREATE TABLE `goods_category` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL, `name` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -219,7 +218,7 @@ CREATE TABLE `invitation` ( ...@@ -219,7 +218,7 @@ CREATE TABLE `invitation` (
`name` varchar(256) DEFAULT NULL, `name` varchar(256) DEFAULT NULL,
`attachment` text, `attachment` text,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -243,7 +242,7 @@ CREATE TABLE `items` ( ...@@ -243,7 +242,7 @@ CREATE TABLE `items` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`item` int DEFAULT NULL, `item` int DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -268,7 +267,7 @@ CREATE TABLE `node` ( ...@@ -268,7 +267,7 @@ CREATE TABLE `node` (
`pid` int DEFAULT NULL, `pid` int DEFAULT NULL,
`val` int DEFAULT NULL, `val` int DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -297,7 +296,7 @@ CREATE TABLE `orders` ( ...@@ -297,7 +296,7 @@ CREATE TABLE `orders` (
`description` varchar(2000) DEFAULT NULL, `description` varchar(2000) DEFAULT NULL,
`ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -361,7 +360,7 @@ CREATE TABLE `orders_log` ( ...@@ -361,7 +360,7 @@ CREATE TABLE `orders_log` (
`direction` varchar(16) DEFAULT NULL, `direction` varchar(16) DEFAULT NULL,
`log_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `log_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`log_id`) PRIMARY KEY (`log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -391,7 +390,7 @@ CREATE TABLE `payment` ( ...@@ -391,7 +390,7 @@ CREATE TABLE `payment` (
`day` date GENERATED ALWAYS AS (cast(`payment_date` as date)) STORED, `day` date GENERATED ALWAYS AS (cast(`payment_date` as date)) STORED,
PRIMARY KEY (`payment_id`), PRIMARY KEY (`payment_id`),
KEY `idx_payment_date` ((cast(`payment_date` as date))) KEY `idx_payment_date` ((cast(`payment_date` as date)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -415,7 +414,7 @@ CREATE TABLE `points` ( ...@@ -415,7 +414,7 @@ CREATE TABLE `points` (
`x` float DEFAULT NULL, `x` float DEFAULT NULL,
`y` float DEFAULT NULL, `y` float DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -440,7 +439,7 @@ CREATE TABLE `stock` ( ...@@ -440,7 +439,7 @@ CREATE TABLE `stock` (
`level` int DEFAULT '1', `level` int DEFAULT '1',
`address` varchar(1024) DEFAULT NULL, `address` varchar(1024) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
...@@ -468,7 +467,7 @@ CREATE TABLE `t8` ( ...@@ -468,7 +467,7 @@ CREATE TABLE `t8` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
SPATIAL KEY `geo_index` (`location`), SPATIAL KEY `geo_index` (`location`),
FULLTEXT KEY `description` (`description`) FULLTEXT KEY `description` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册