mirror of
https://gitlab01.pm.org.ru/tnt/liquibase/liquibase-maven.git
synced 2026-01-12 09:24:47 +08:00
Update file README.md
This commit is contained in:
parent
e02129560a
commit
dc562e705f
70
README.md
Normal file
70
README.md
Normal file
@ -0,0 +1,70 @@
|
||||
### 0. Структура проекта
|
||||
```shell
|
||||
.
|
||||
├── 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. clean-up all views before liquibase diff.Views script
|
||||
|
||||
```shell
|
||||
mvn liquibase:diff -Denv=cleanup.views -X > cleanup.views/liquibase_log/liquibase_log_diff-$(date +%Y%m%d%H%M%S).log
|
||||
```
|
||||
|
||||
```shell
|
||||
mvn liquibase:update -Denv=cleanup.views
|
||||
```
|
||||
|
||||
### 2. liquibase diff.tables script
|
||||
|
||||
```shell
|
||||
mvn liquibase:diff -Denv=cleanup.tables -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
|
||||
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user