Compare commits

...
15 Commits
Author SHA1 Message Date
pashko 88f3011e06 Update README02 2024-06-04 14:16:18 +08:00
pashko c810fd3c1b Update README02 2024-05-30 17:40:23 +08:00
pashko d21c96dca1 Add README02 2024-05-30 17:37:23 +08:00
pashko 25c9a23b6c change README.md 2024-05-15 19:38:31 +08:00
pashko 3a4dcdc1ca change README.md 2024-05-15 16:11:48 +08:00
pashko d48d2721c6 change README.md 2024-05-08 14:38:29 +08:00
pashko fb890fb324 change README.md 2024-05-08 14:20:38 +08:00
pashko eed3857728 change README.md 2024-05-03 19:33:00 +08:00
pashko a6ab535c47 change README.md 2024-05-03 19:17:56 +08:00
pashko d0239ce2f7 change README.md, delete include dir diff-changelog from changelog-dir/changelog-master.xml 2024-05-03 10:58:52 +08:00
pashko af3d3e83bd change README.md, delete changelog-dir/my_function.sql 2024-05-03 09:24:57 +08:00
pashko 8e86a8c181 change README.md 2024-05-02 22:45:02 +08:00
pashko 20b71a2234 change README.md 2024-05-02 20:39:49 +08:00
pashko abf63179c6 add README.md 2024-05-02 20:34:52 +08:00
pashko 1e7545e050 add README.md 2024-05-02 20:22:53 +08:00
6 changed files with 110 additions and 11 deletions
+2
View File
@@ -1,3 +1,5 @@
diff-changelog
liquibase_log
*.log
*.csv
*.sql
+59
View File
@@ -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 $$;
```
+34
View File
@@ -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
+1 -6
View File
@@ -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/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<!-- <changeSet author="" dbms="postgresql" id="1713864000000-1">
<sqlFile path="changelog-dir/my_function.sql" splitStatements="false"/>
</changeSet> -->
<includeAll path="changelog-dir/diff-changelog/"/>
<includeAll path="changelog-dir/update-changelog/"/>
</databaseChangeLog>
+13
View File
@@ -0,0 +1,13 @@
username:dbuser01
password:QWEasd759
defaultSchemaName: public
liquibaseSchemaName: liquibase
referenceUsername: dbuser01
referencePassword: QWEasd759
referenceDefaultSchemaName:public
referenceLiquibaseSchemaName: liquibase
+1 -5
View File
@@ -36,20 +36,16 @@
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.27.0</version>
<configuration>
<propertyFile>liquibase.properties</propertyFile>
<changeLogFile>changelog-dir/changelog-master.xml</changeLogFile>
<!-- <changeLogDirectory>changelog-dir/</changeLogDirectory> -->
<outputChangeLogFile>changelog-dir/changelog-master.xml</outputChangeLogFile>
<diffChangeLogFile>changelog-dir/diff-changelog/liquibase-diffChangeLog-${maven.build.timestamp}.sql</diffChangeLogFile>
<changelogSchemaName>liquibase</changelogSchemaName>
<defaultSchemaName>public</defaultSchemaName>
<driver>org.postgresql.Driver</driver>
<username>dbuser01</username>
<password>QWEasd759</password>
<url>jdbc:postgresql://10.2.5.46:5432/db02-pom</url>
<referenceDriver>org.postgresql.Driver</referenceDriver>
<referenceUrl>jdbc:postgresql://10.2.5.47:5432/db01-pom</referenceUrl>
<referenceUsername>dbuser01</referenceUsername>
<referencePassword>QWEasd759</referencePassword>
<goal>diff</goal>
<dataDir>/data</dataDir>
<verbose>true</verbose>