Skip to content

Commit

Permalink
v6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanow committed Dec 5, 2023
1 parent 1dee579 commit 237da0a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

migration-application:
build: .
image: romanowalex/migration-application:v5.0
image: romanowalex/migration-application:v6.0
container_name: migration-application
environment:
SPRING_PROFILES_ACTIVE: docker
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
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
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>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DatabaseMigrationApplicationTest {
status { isOk() }
content {
jsonPath("$") { isArray() }
jsonPath("$.length()") { value(5) }
jsonPath("$.length()") { value(10) }
}
}
}
Expand Down

0 comments on commit 237da0a

Please sign in to comment.