Kaynağa Gözat

change script

remy.liu 4 yıl önce
ebeveyn
işleme
4db75ad4fa

+ 10 - 2
init-db/src/main/resources/db/migration/V1__init-db.sql

@@ -73,7 +73,9 @@ CREATE TABLE IF NOT EXISTS `t_user` (
 INSERT INTO `t_user` (`id`, `create_time`, `update_time`, `age`, `birthday`, `gender`, `img`, `level`, `nickname`, `password`, `username`) VALUES
 (3, '2021-06-18 10:26:10.914000', '2021-06-18 10:26:10.914000', 30, '1985-02-22', 'MALE', 'https://www.baidu.com', 1, '小明', '3A548574B23819E3AF577B795AB8A147', 'remylee'),
 (4, '2021-06-21 19:02:34.540000', '2021-06-21 19:02:34.540000', 22, '1999-12-21', 'MALE', 'https://graphql.cn/img/logo.svg', 2, '杰克', '4D81FF7831351A0AEB58CC1719429002', 'jack'),
-(5, '2021-06-21 19:03:18.924000', '2021-06-21 19:03:18.924000', 21, '2000-02-12', 'FEMALE', 'https://graphql.cn/img/logo.svg', 3, '柔丝', '08DF54DA47C5E343DA8ABD541FEF87F6', 'rose');
+(5, '2021-06-21 19:03:18.924000', '2021-06-21 19:03:18.924000', 21, '2000-02-12', 'FEMALE', 'https://graphql.cn/img/logo.svg', 3, '柔丝', '08DF54DA47C5E343DA8ABD541FEF87F6', 'rose'),
+(6, '2021-07-11 13:24:14.252000', '2021-07-11 13:24:14.252000', 33, '1988-05-20', 'MALE', 'http://www.baidu.com', 1, '汤姆', '439B4C7705C02A550474CA2BCF7EA9AE', 'tom');
+
 
 
 CREATE TABLE IF NOT EXISTS `user_addresses` (
@@ -86,4 +88,10 @@ CREATE TABLE IF NOT EXISTS `user_addresses` (
 INSERT INTO `user_addresses` (`user_id`, `addresses`) VALUES
 (3, '上海'),
 (3, '北京'),
-(3, '重庆');
+(3, '重庆'),
+(6, '南京'),
+(6, '天津'),
+(6, '天水'),
+(6, '洛杉矶'),
+(6, '格尔木');
+

+ 5 - 1
init-db/src/main/resources/db/migration/V2__add-comment.sql

@@ -9,4 +9,8 @@ CREATE TABLE IF NOT EXISTS `t_comment`
     `userid`          bigint(20)   DEFAULT NULL,
     PRIMARY KEY (`id`)
 ) ENGINE = InnoDB
-  DEFAULT CHARSET = utf8mb4;
+  DEFAULT CHARSET = utf8mb4;
+
+INSERT INTO `t_comment` (`id`, `create_time`, `update_time`, `content`, `goods_serial_no`, `order_no`, `userid`)
+VALUES
+(1, '2021-07-11 12:53:34.622000', '2021-07-11 12:53:34.622000', '这个东西非常好用哦', 'pYmhjY58', '4bvd9i9pte', 3);

+ 16 - 0
init-db/src/main/resources/db/migration/V3__add-attentions.sql

@@ -0,0 +1,16 @@
+CREATE TABLE `user_attention_ids` (
+  `user_id` bigint(20) NOT NULL,
+  `attention_ids` bigint(20) DEFAULT NULL,
+  KEY `FKjruoxsm5isj8qrkofpgwuhhqd` (`user_id`),
+  CONSTRAINT `FKjruoxsm5isj8qrkofpgwuhhqd` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `user_attention_ids` (`user_id`, `attention_ids`)
+VALUES
+	(3,4),
+	(3,5),
+	(4,3),
+	(5,4),
+	(6,3),
+	(6,4),
+	(6,5);