mirror of
https://gitlab01.pm.org.ru/tnt/liquibase/liquibase-maven.git
synced 2026-01-12 09:04:48 +08:00
Update 12 files
- /target/liquibase/migrate.sql - /prod/liquibase.properties - /dev/liquibase.properties - /README.md - /cleanup.views/changelog-dir/changelog-master.xml - /cleanup.views/changelog-dir/cleanup_all_views/01_cleanup-allviews.sql - /cleanup.views/liquibase.properties - /diff.tables/changelog-dir/changelog-master.xml - /diff.tables/liquibase.properties - /diff.views/changelog-dir/changelog-master.xml - /diff.views/changelog-dir/drop_liquibase_tables/02_drop_liquibase_tables_ceanup.sql - /diff.views/liquibase.properties
This commit is contained in:
parent
dc562e705f
commit
28d7981f4e
33
README.md
33
README.md
@ -49,7 +49,7 @@ mvn liquibase:update -Denv=cleanup.views
|
|||||||
### 2. liquibase diff.tables script
|
### 2. liquibase diff.tables script
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mvn liquibase:diff -Denv=cleanup.tables -X > diff.tables/liquibase_log/liquibase_log_diff-$(date +%Y%m%d%H%M%S).log
|
mvn liquibase:diff -Denv=diff.tables -X > diff.tables/liquibase_log/liquibase_log_diff-$(date +%Y%m%d%H%M%S).log
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -66,5 +66,36 @@ mv diff.tables/changelog-dir/diff-changelog/*.sql diff.tables/changelog-dir/u
|
|||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
mvn liquibase:update -X > diff.tables/liquibase_log/liquibase_log_update-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:history > diff.tables/liquibase_log/liquibase_log_history-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. liquibase diff.views script
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:diff -Denv=diff.views -X > diff.tables/liquibase_log/liquibase_log_diff-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sed -i 's/JSONB DEFAULT \x7B\x7D/\jsonb DEFAULT \x27\x7B\x7D\x27/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
sed -i 's/JSONB DEFAULT \[\]/\jsonb DEFAULT \x27\[\]\x27/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
sed -i 's/\x220001-01-01T00:00:00+00:00\x22/\x27\[\x220001-01-01T00:00:00+00:00\x22\]\x27/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
sed -i 's/JSONB DEFAULT \x7B\x7D/\jsonb DEFAULT \x27\x7B\x7D\x27\x3A\x3Ajsonb/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
sed -i 's/JSONB DEFAULT \[\]/\jsonb DEFAULT \x27\[\]\x27\x3A\x3Ajsonb/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
sed -i 's/\x3F/\x3F\x3F/g' changelog-dir/diff-changelog/*.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mv diff.tables/changelog-dir/diff-changelog/*.sql diff.tables/changelog-dir/update-changelog/
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:update -X > diff.tables/liquibase_log/liquibase_log_update-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:history > diff.tables/liquibase_log/liquibase_log_history-$(date +%Y%m%d%H%M%S).log
|
||||||
```
|
```
|
||||||
0
cleanup.views/changelog-dir/changelog-master.xml
Normal file
0
cleanup.views/changelog-dir/changelog-master.xml
Normal file
@ -1,7 +0,0 @@
|
|||||||
# username=dbuser01
|
|
||||||
# password=QWEasd759
|
|
||||||
# url=jdbc:postgresql://10.2.5.47:5432/db01
|
|
||||||
# driver=org.postgresql.Driver
|
|
||||||
# classpath=/opt/liquibase/postgresql-42.6.0.jar
|
|
||||||
# changeLogFile=master.xml
|
|
||||||
# liquibaseSchemaName=liquibase
|
|
||||||
0
diff.tables/changelog-dir/changelog-master.xml
Normal file
0
diff.tables/changelog-dir/changelog-master.xml
Normal file
13
diff.tables/liquibase.properties
Normal file
13
diff.tables/liquibase.properties
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# url=jdbc:postgresql://10.2.5.46:5432/db01
|
||||||
|
# username=dbuser01
|
||||||
|
# password=QWEasd759
|
||||||
|
|
||||||
|
# driver=org.postgresql.Driver
|
||||||
|
# classpath=/opt/liquibase/postgresql-42.6.0.jar
|
||||||
|
# changeLogFile=master.xml
|
||||||
|
# liquibaseSchemaName=liquibase
|
||||||
|
# defaultSchemaName=public
|
||||||
|
|
||||||
|
# referenceUrl=jdbc:postgresql://10.2.5.47:5432/db01
|
||||||
|
# referenceUsername=dbuser01
|
||||||
|
# referencePassword=QWEasd759
|
||||||
0
diff.views/changelog-dir/changelog-master.xml
Normal file
0
diff.views/changelog-dir/changelog-master.xml
Normal file
13
diff.views/liquibase.properties
Normal file
13
diff.views/liquibase.properties
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# url=jdbc:postgresql://10.2.5.46:5432/db01
|
||||||
|
# username=dbuser01
|
||||||
|
# password=QWEasd759
|
||||||
|
|
||||||
|
# driver=org.postgresql.Driver
|
||||||
|
# classpath=/opt/liquibase/postgresql-42.6.0.jar
|
||||||
|
# changeLogFile=master.xml
|
||||||
|
# liquibaseSchemaName=liquibase
|
||||||
|
# defaultSchemaName=public
|
||||||
|
|
||||||
|
# referenceUrl=jdbc:postgresql://10.2.5.47:5432/db01
|
||||||
|
# referenceUsername=dbuser01
|
||||||
|
# referencePassword=QWEasd759
|
||||||
@ -1,25 +0,0 @@
|
|||||||
-- *********************************************************************
|
|
||||||
-- Update Database Script
|
|
||||||
-- *********************************************************************
|
|
||||||
-- Change Log: prod/master.xml
|
|
||||||
-- Ran at: 17.04.2024, 17:39
|
|
||||||
-- Against: dbuser01@jdbc:postgresql://10.2.5.46:5432/db01
|
|
||||||
-- Liquibase version: 4.17.0
|
|
||||||
-- *********************************************************************
|
|
||||||
|
|
||||||
SET SEARCH_PATH TO public, "$user","public";
|
|
||||||
|
|
||||||
-- Lock Database
|
|
||||||
UPDATE databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = 'centos7-netcore (10.2.5.28)', LOCKGRANTED = NOW() WHERE ID = 1 AND LOCKED = FALSE;
|
|
||||||
|
|
||||||
SET SEARCH_PATH TO public, "$user","public";
|
|
||||||
|
|
||||||
SET SEARCH_PATH TO public, "$user","public";
|
|
||||||
|
|
||||||
-- Release Database Lock
|
|
||||||
SET SEARCH_PATH TO public, "$user","public";
|
|
||||||
|
|
||||||
UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
|
|
||||||
|
|
||||||
SET SEARCH_PATH TO public, "$user","public";
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user