-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
3 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
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,3 +1,3 @@ | ||
version=5.0 | ||
version=6.0 | ||
group=ru.romanow.migration | ||
org.gradle.daemon=true |
39 changes: 39 additions & 0 deletions
39
src/main/resources/db/liquibase/changelog/v6.0_EnlargeLoginFieldSize.xml
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
logicalFilePath="v6.0_EnlargeLoginFieldSize.xml" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.20.xsd"> | ||
<changeSet id="1" author="aromanow" labels="v6.0"> | ||
<sql> | ||
ALTER TABLE users | ||
ALTER COLUMN name SET DATA TYPE VARCHAR(80); | ||
</sql> | ||
<rollback> | ||
<sql> | ||
DELETE FROM users WHERE length(name) > 10; | ||
|
||
ALTER TABLE users | ||
ALTER COLUMN name SET DATA TYPE VARCHAR(10); | ||
</sql> | ||
</rollback> | ||
</changeSet> | ||
<changeSet id="2" author="aromanow" labels="v6.0"> | ||
<sql> | ||
INSERT INTO address (city) VALUES ('New York') ON CONFLICT DO NOTHING; | ||
|
||
INSERT INTO users (name, status, address_id) | ||
VALUES ('Alexander', 'NEW', (SELECT id FROM address WHERE city = 'Moscow')), | ||
('Maximilian', 'NEW', (SELECT id FROM address WHERE city = 'New York')), | ||
('Christopher', 'NEW', (SELECT id FROM address WHERE city = 'New York')), | ||
('William', 'NEW', (SELECT id FROM address WHERE city = 'New York')), | ||
('Charlotte', 'NEW', (SELECT id FROM address WHERE city = 'New York')) | ||
ON CONFLICT DO NOTHING; | ||
</sql> | ||
<rollback>empty</rollback> | ||
</changeSet> | ||
<changeSet id="3" author="aromanow" labels="v6.0"> | ||
<tagDatabase tag="v6.0"/> | ||
</changeSet> | ||
</databaseChangeLog> |
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