Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1d660d7

Browse files
committedSep 3, 2019
feature: 增加测试用数据库
1 parent 7732c29 commit 1d660d7

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
 

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ $ npm install
1919

2020
修改 `ormconfig.js` 参照 `ormconfig.js.example`
2121

22+
测试数据库为 `apijson.sql`, 如需体验可自行导入本地数据库测试
23+
2224
{
2325
"type": "mysql",
2426
"host": "localhost",

‎apijson.sql

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
Navicat Premium Data Transfer
3+
4+
Source Server : localhost_3306
5+
Source Server Type : MySQL
6+
Source Server Version : 80017
7+
Source Host : localhost:3306
8+
Source Schema : apijson
9+
10+
Target Server Type : MySQL
11+
Target Server Version : 80017
12+
File Encoding : 65001
13+
14+
Date: 03/09/2019 13:08:54
15+
*/
16+
17+
SET NAMES utf8mb4;
18+
SET FOREIGN_KEY_CHECKS = 0;
19+
20+
-- ----------------------------
21+
-- Table structure for comment
22+
-- ----------------------------
23+
DROP TABLE IF EXISTS `comment`;
24+
CREATE TABLE `comment` (
25+
`id` int(11) NOT NULL AUTO_INCREMENT,
26+
`comment` varchar(255) DEFAULT NULL,
27+
`userId` int(11) DEFAULT NULL,
28+
PRIMARY KEY (`id`)
29+
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
30+
31+
-- ----------------------------
32+
-- Records of comment
33+
-- ----------------------------
34+
BEGIN;
35+
INSERT INTO `comment` VALUES (1, 'test', 2);
36+
INSERT INTO `comment` VALUES (2, 'hello', 3);
37+
INSERT INTO `comment` VALUES (3, 'world', 3);
38+
COMMIT;
39+
40+
-- ----------------------------
41+
-- Table structure for user
42+
-- ----------------------------
43+
DROP TABLE IF EXISTS `user`;
44+
CREATE TABLE `user` (
45+
`id` int(11) NOT NULL AUTO_INCREMENT,
46+
`user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
47+
`nickname` varchar(255) DEFAULT NULL,
48+
`role` varchar(255) DEFAULT NULL,
49+
PRIMARY KEY (`id`)
50+
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
51+
52+
-- ----------------------------
53+
-- Records of user
54+
-- ----------------------------
55+
BEGIN;
56+
INSERT INTO `user` VALUES (2, 'kevin', 'coldplay', 'boss');
57+
INSERT INTO `user` VALUES (3, 'tony', 'tiger', 'employee');
58+
INSERT INTO `user` VALUES (4, 'iris', 'cruise', 'employee');
59+
COMMIT;
60+
61+
SET FOREIGN_KEY_CHECKS = 1;

0 commit comments

Comments
 (0)
Please sign in to comment.