-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #733 from liquibase/DAT-16820
DAT-16820. refactored cloud DBs init-scripts to follow Liquibase atomic changes best practice
- Loading branch information
Showing
10 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--liquibase formatted sql | ||
--changeset liquibase:1 runAlways:true | ||
|
||
DROP TABLE IF EXISTS `authors`; | ||
CREATE TABLE `authors` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
|
@@ -12,12 +11,14 @@ CREATE TABLE `authors` ( | |
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO `authors` VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS `posts`; | ||
CREATE TABLE `posts` ( | ||
`id` int(11) NOT NULL, | ||
|
@@ -28,6 +29,7 @@ CREATE TABLE `posts` ( | |
`inserted_date` date | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO `posts` VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
--liquibase formatted sql | ||
--changeset liquibase:1 runAlways:true | ||
|
||
DROP TABLE IF EXISTS [dbo].[authors] | ||
|
||
CREATE TABLE [dbo].[authors]( | ||
[id] [int] NOT NULL, | ||
[first_name] [varchar](255) NOT NULL, | ||
|
@@ -13,15 +11,16 @@ CREATE TABLE [dbo].[authors]( | |
CONSTRAINT [PK_PrimaryKey] PRIMARY KEY ([id]) | ||
) ON [PRIMARY] | ||
|
||
INSERT INTO [dbo].[authors] ([id],[first_name],[last_name],[email],[birthdate],[added]) | ||
VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO [dbo].[authors] ([id],[first_name],[last_name],[email],[birthdate],[added]) | ||
VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00') | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS [dbo].[posts] | ||
|
||
CREATE TABLE [dbo].[posts]( | ||
[id] [int] NOT NULL, | ||
[author_id] [int] NOT NULL, | ||
|
@@ -31,8 +30,9 @@ CREATE TABLE [dbo].[posts]( | |
[inserted_date] [date] NULL | ||
) ON [PRIMARY] | ||
|
||
INSERT INTO [dbo].[posts] ([id],[author_id],[title],[description],[content],[inserted_date]) | ||
VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO [dbo].[posts] ([id],[author_id],[title],[description],[content],[inserted_date]) | ||
VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
('4','4','itaque','deleniti','Magni nam optio id recusandae.','2010-07-28'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,14 @@ CREATE TABLE `authors` ( | |
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO `authors` VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS `posts`; | ||
CREATE TABLE `posts` ( | ||
`id` int(11) NOT NULL, | ||
|
@@ -27,10 +29,12 @@ CREATE TABLE `posts` ( | |
`inserted_date` date | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO `posts` VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
('4','4','itaque','deleniti','Magni nam optio id recusandae.','2010-07-28'), | ||
('5','5','ad','similique','Rerum tempore quis ut nesciunt qui excepturi est.','2006-10-09'); | ||
|
||
--changeset liquibase:5 runAlways:true | ||
SET GLOBAL log_bin_trust_function_creators = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,14 @@ CREATE TABLE authors ( | |
PRIMARY KEY (id) | ||
); | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO authors VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS posts; | ||
CREATE TABLE posts ( | ||
id SERIAL, | ||
|
@@ -28,7 +29,7 @@ CREATE TABLE posts ( | |
inserted_date date | ||
); | ||
|
||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO posts VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,14 @@ CREATE TABLE `authors` ( | |
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO `authors` VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS `posts`; | ||
CREATE TABLE `posts` ( | ||
`id` int(11) NOT NULL, | ||
|
@@ -27,6 +29,7 @@ CREATE TABLE `posts` ( | |
`inserted_date` date | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO `posts` VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,14 @@ CREATE TABLE authors ( | |
PRIMARY KEY (id) | ||
); | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO authors VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS posts; | ||
CREATE TABLE posts ( | ||
id SERIAL, | ||
|
@@ -28,7 +29,7 @@ CREATE TABLE posts ( | |
inserted_date date | ||
); | ||
|
||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO posts VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ CREATE TABLE [dbo].[authors]( | |
) ON [PRIMARY] | ||
GO | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO [dbo].[authors] ([id],[first_name],[last_name],[email],[birthdate],[added]) | ||
VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
|
@@ -22,6 +23,7 @@ VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 0 | |
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00') | ||
GO | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS [dbo].[posts] | ||
GO | ||
|
||
|
@@ -35,6 +37,7 @@ CREATE TABLE [dbo].[posts]( | |
) ON [PRIMARY] | ||
GO | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO [dbo].[posts] ([id],[author_id],[title],[description],[content],[inserted_date]) | ||
VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ BEGIN | |
EXEC sp_addrolemember 'db_owner', 'lbuser'; | ||
END | ||
|
||
--changeset liquibase:2 runAlways:true | ||
DROP TABLE IF EXISTS [lbuser].[authors] | ||
|
||
CREATE TABLE [lbuser].[authors]( | ||
|
@@ -25,13 +26,15 @@ CREATE TABLE [lbuser].[authors]( | |
CONSTRAINT [PK_PrimaryKey] PRIMARY KEY ([id]) | ||
) ON [PRIMARY] | ||
|
||
INSERT INTO [lbuser].[authors] ([id],[first_name],[last_name],[email],[birthdate],[added]) | ||
VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
--changeset liquibase:3 runAlways:true | ||
INSERT INTO [lbuser].[authors] ([id],[first_name],[last_name],[email],[birthdate],[added]) | ||
VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00') | ||
|
||
--changeset liquibase:4 runAlways:true | ||
DROP TABLE IF EXISTS [lbuser].[posts] | ||
|
||
CREATE TABLE [lbuser].[posts]( | ||
|
@@ -43,8 +46,9 @@ CREATE TABLE [lbuser].[posts]( | |
[inserted_date] [date] NULL | ||
) ON [PRIMARY] | ||
|
||
INSERT INTO [lbuser].[posts] ([id],[author_id],[title],[description],[content],[inserted_date]) | ||
VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
--changeset liquibase:5 runAlways:true | ||
INSERT INTO [lbuser].[posts] ([id],[author_id],[title],[description],[content],[inserted_date]) | ||
VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
('4','4','itaque','deleniti','Magni nam optio id recusandae.','2010-07-28'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,14 @@ CREATE TABLE `authors` ( | |
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO `authors` VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS `posts`; | ||
CREATE TABLE `posts` ( | ||
`id` int(11) NOT NULL, | ||
|
@@ -27,6 +29,7 @@ CREATE TABLE `posts` ( | |
`inserted_date` date | ||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO `posts` VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
-- liquibase formatted sql | ||
-- changeset liquibase:1 runAlways:true | ||
|
||
DROP TABLE IF EXISTS AUTHORS; | ||
CREATE TABLE AUTHORS ( | ||
id int AUTOINCREMENT(6,1) NOT NULL, | ||
|
@@ -12,12 +11,14 @@ CREATE TABLE AUTHORS ( | |
PRIMARY KEY (id) | ||
); | ||
|
||
--changeset liquibase:2 runAlways:true | ||
INSERT INTO AUTHORS VALUES ('1','Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25'), | ||
('2','Tamia','Mayert','[email protected]','2016-03-27','2014-03-21 02:52:00'), | ||
('3','Cyril','Funk','[email protected]','1988-04-21','2011-06-24 18:17:48'), | ||
('4','Nicolas','Buckridge','[email protected]','2017-02-03','2019-04-22 02:04:41'), | ||
('5','Jayden','Walter','[email protected]','2010-02-27','1990-02-04 02:32:00'); | ||
|
||
--changeset liquibase:3 runAlways:true | ||
DROP TABLE IF EXISTS POSTS; | ||
CREATE TABLE POSTS ( | ||
id int NOT NULL, | ||
|
@@ -28,6 +29,7 @@ CREATE TABLE POSTS ( | |
inserted_date date | ||
); | ||
|
||
--changeset liquibase:4 runAlways:true | ||
INSERT INTO POSTS VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'), | ||
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'), | ||
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'), | ||
|