Compare commits
15
Commits
53b3cb3648
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88f3011e06 | ||
|
|
c810fd3c1b | ||
|
|
d21c96dca1 | ||
|
|
25c9a23b6c | ||
|
|
3a4dcdc1ca | ||
|
|
d48d2721c6 | ||
|
|
fb890fb324 | ||
|
|
eed3857728 | ||
|
|
a6ab535c47 | ||
|
|
d0239ce2f7 | ||
|
|
af3d3e83bd | ||
|
|
8e86a8c181 | ||
|
|
20b71a2234 | ||
|
|
abf63179c6 | ||
|
|
1e7545e050 |
@@ -1,3 +1,5 @@
|
|||||||
diff-changelog
|
diff-changelog
|
||||||
|
liquibase_log
|
||||||
|
*.log
|
||||||
*.csv
|
*.csv
|
||||||
*.sql
|
*.sql
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
|
||||||
|
```shell
|
||||||
|
.
|
||||||
|
├── changelog-dir
|
||||||
|
│ ├── changelog-master.xml
|
||||||
|
│ ├── diff-changelog
|
||||||
|
│ └── update-changelog
|
||||||
|
│ └── liquibase-diffChangeLog-20240503024308.sql
|
||||||
|
├── liquibase_log
|
||||||
|
│ ├── liquibase_log_diff-20240503104305.log
|
||||||
|
│ ├── liquibase_log_history-20240503104702.log
|
||||||
|
│ └── liquibase_log_update-20240503104616.log
|
||||||
|
├── liquibase.properties
|
||||||
|
├── pom.xml
|
||||||
|
└── README.md
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 1. bla
|
||||||
|
```shell
|
||||||
|
mvn liquibase:diff -X > liquibase_log/liquibase_log_diff-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. bla
|
||||||
|
|
||||||
|
* 2.1. asdasdasd
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
* 2.2. asdasdasd
|
||||||
|
```shell
|
||||||
|
mv changelog-dir/diff-changelog/*.sql changelog-dir/update-changelog/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. asdasdsda
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:update -X > liquibase_log/liquibase_log_update-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
#### 4. asdasdsda
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn liquibase:history > liquibase_log/liquibase_log_history-$(date +%Y%m%d%H%M%S).log
|
||||||
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
do $$ declare
|
||||||
|
r record;
|
||||||
|
begin
|
||||||
|
for r in (select tablename from pg_tables where schemaname = 'my-schema-name') loop
|
||||||
|
execute 'drop table if exists public.' || quote_ident(r.tablename) || ' cascade';
|
||||||
|
end loop;
|
||||||
|
end $$;
|
||||||
|
```
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
.
|
||||||
|
├── cleanup.views
|
||||||
|
│ ├── changelog-dir
|
||||||
|
│ │ ├── changelog-master.xml
|
||||||
|
│ │ ├── cleanup_all_views
|
||||||
|
│ │ │ └── 01_cleanup-allviews.sql
|
||||||
|
│ │ └── diff.views.changelog
|
||||||
|
│ ├── liquibase_log
|
||||||
|
│ └── liquibase.properties
|
||||||
|
├── diff.tables
|
||||||
|
│ ├── changelog-dir
|
||||||
|
│ │ ├── changelog-master.xml
|
||||||
|
│ │ ├── diff-changelog
|
||||||
|
│ │ ├── function_before_create_tables
|
||||||
|
│ │ ├── functions
|
||||||
|
│ │ ├── functions_after_create_tables
|
||||||
|
│ │ └── update-changelog
|
||||||
|
│ ├── liquibase_log
|
||||||
|
│ └── liquibase.properties
|
||||||
|
├── diff.views
|
||||||
|
│ ├── changelog-dir
|
||||||
|
│ │ ├── changelog-master.xml
|
||||||
|
│ │ ├── diff-changelog
|
||||||
|
│ │ ├── drop_liquibase_tables
|
||||||
|
│ │ │ └── 02_drop_liquibase_tables_ceanup.sql
|
||||||
|
│ │ ├── function_before_create_views
|
||||||
|
│ │ ├── functions
|
||||||
|
│ │ ├── functions_after_create_views
|
||||||
|
│ │ └── update-changelog
|
||||||
|
│ ├── liquibase_log
|
||||||
|
│ └── liquibase.properties
|
||||||
|
├── package
|
||||||
|
├── pom.xml
|
||||||
|
└── REAMDME.md
|
||||||
@@ -9,10 +9,5 @@
|
|||||||
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd
|
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd
|
||||||
http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||||
|
|
||||||
<!-- <changeSet author="" dbms="postgresql" id="1713864000000-1">
|
<includeAll path="changelog-dir/update-changelog/"/>
|
||||||
<sqlFile path="changelog-dir/my_function.sql" splitStatements="false"/>
|
|
||||||
</changeSet> -->
|
|
||||||
|
|
||||||
<includeAll path="changelog-dir/diff-changelog/"/>
|
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
username:dbuser01
|
||||||
|
password:QWEasd759
|
||||||
|
defaultSchemaName: public
|
||||||
|
liquibaseSchemaName: liquibase
|
||||||
|
|
||||||
|
|
||||||
|
referenceUsername: dbuser01
|
||||||
|
referencePassword: QWEasd759
|
||||||
|
referenceDefaultSchemaName:public
|
||||||
|
referenceLiquibaseSchemaName: liquibase
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,20 +36,16 @@
|
|||||||
<artifactId>liquibase-maven-plugin</artifactId>
|
<artifactId>liquibase-maven-plugin</artifactId>
|
||||||
<version>4.27.0</version>
|
<version>4.27.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<propertyFile>liquibase.properties</propertyFile>
|
||||||
<changeLogFile>changelog-dir/changelog-master.xml</changeLogFile>
|
<changeLogFile>changelog-dir/changelog-master.xml</changeLogFile>
|
||||||
<!-- <changeLogDirectory>changelog-dir/</changeLogDirectory> -->
|
|
||||||
<outputChangeLogFile>changelog-dir/changelog-master.xml</outputChangeLogFile>
|
<outputChangeLogFile>changelog-dir/changelog-master.xml</outputChangeLogFile>
|
||||||
<diffChangeLogFile>changelog-dir/diff-changelog/liquibase-diffChangeLog-${maven.build.timestamp}.sql</diffChangeLogFile>
|
<diffChangeLogFile>changelog-dir/diff-changelog/liquibase-diffChangeLog-${maven.build.timestamp}.sql</diffChangeLogFile>
|
||||||
<changelogSchemaName>liquibase</changelogSchemaName>
|
<changelogSchemaName>liquibase</changelogSchemaName>
|
||||||
<defaultSchemaName>public</defaultSchemaName>
|
<defaultSchemaName>public</defaultSchemaName>
|
||||||
<driver>org.postgresql.Driver</driver>
|
<driver>org.postgresql.Driver</driver>
|
||||||
<username>dbuser01</username>
|
|
||||||
<password>QWEasd759</password>
|
|
||||||
<url>jdbc:postgresql://10.2.5.46:5432/db02-pom</url>
|
<url>jdbc:postgresql://10.2.5.46:5432/db02-pom</url>
|
||||||
<referenceDriver>org.postgresql.Driver</referenceDriver>
|
<referenceDriver>org.postgresql.Driver</referenceDriver>
|
||||||
<referenceUrl>jdbc:postgresql://10.2.5.47:5432/db01-pom</referenceUrl>
|
<referenceUrl>jdbc:postgresql://10.2.5.47:5432/db01-pom</referenceUrl>
|
||||||
<referenceUsername>dbuser01</referenceUsername>
|
|
||||||
<referencePassword>QWEasd759</referencePassword>
|
|
||||||
<goal>diff</goal>
|
<goal>diff</goal>
|
||||||
<dataDir>/data</dataDir>
|
<dataDir>/data</dataDir>
|
||||||
<verbose>true</verbose>
|
<verbose>true</verbose>
|
||||||
|
|||||||
Reference in New Issue
Block a user