forked from go-gorm/gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tables.sql
99 lines (88 loc) · 3.62 KB
/
tables.sql
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
-- -------------------------------------------------------------
-- Database: gen
-- Generation Time: 2022-08-29 11:37:29.2770
-- -------------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `banks`;
CREATE TABLE `banks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` longtext,
`address` longtext,
`scale` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `credit_cards`;
CREATE TABLE `credit_cards` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime(3) DEFAULT NULL,
`updated_at` datetime(3) DEFAULT NULL,
`deleted_at` datetime(3) DEFAULT NULL,
`number` longtext,
`customer_refer` bigint(20) unsigned DEFAULT NULL,
`bank_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_credit_cards_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime(3) DEFAULT NULL,
`updated_at` datetime(3) DEFAULT NULL,
`deleted_at` datetime(3) DEFAULT NULL,
`bank_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_customers_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `people`;
CREATE TABLE `people` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`age` int(11) unsigned DEFAULT NULL,
`flag` tinyint(1) DEFAULT NULL,
`another_flag` tinyint(4) DEFAULT NULL,
`commit` varchar(255) DEFAULT NULL,
`First` tinyint(1) DEFAULT NULL,
`bit` bit(1) DEFAULT NULL,
`small` smallint(5) unsigned DEFAULT NULL,
`deleted_at` datetime(3) DEFAULT NULL,
`score` decimal(19,0) DEFAULT NULL,
`number` int(11) DEFAULT NULL,
`birth` datetime DEFAULT CURRENT_TIMESTAMP,
`xmlHTTPRequest` varchar(255) DEFAULT ' ',
`jStr` json DEFAULT NULL,
`geo` geometry DEFAULT NULL,
`mint` mediumint(9) DEFAULT NULL,
`blank` varchar(64) DEFAULT ' ',
`remark` text,
`long_remark` longtext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime(3) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL COMMENT 'oneline',
`address` varchar(255) DEFAULT '',
`register_time` datetime(3) DEFAULT NULL,
`alive` tinyint(1) DEFAULT NULL COMMENT 'multiline\nline1\nline2',
`company_id` bigint(20) unsigned DEFAULT '666',
`private_url` varchar(255) DEFAULT 'https://a.b.c ',
PRIMARY KEY (`id`),
KEY `idx_name` (`name`) USING BTREE,
KEY `idx_name_company_id` (`name`,`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;