2022-09-07 14:04:45 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-09-26 10:57:22 +02:00
|
|
|
sourceLower=partner
|
|
|
|
targetLower=relationship
|
|
|
|
|
|
|
|
sourceStudly=Partner
|
|
|
|
targetStudly=Relationship
|
|
|
|
|
|
|
|
## for source in `find src -iname ""*$sourceLower*"" -type f \( -iname \*.yaml -o -iname \*.sql -o -iname \*.java \)`; do
|
|
|
|
for source in `find src -iname ""*$sourceLower*"" -type f \( -iname \*.yaml \)`; do
|
|
|
|
target=`echo $source | sed -e "s/$sourceStudly/$targetStudly/g" -e "s/$sourceLower/$targetLower/g"`
|
|
|
|
echo "Generating $target from $source:"
|
|
|
|
|
|
|
|
mkdir -p `dirname $target`
|
|
|
|
|
|
|
|
sed -e 's/hs-office-partner/hs-office-relationship/g' \
|
|
|
|
-e 's/hs_office_partner/hs_office_relationship/g' \
|
|
|
|
-e 's/HsOfficePartner/HsOfficeRelationship/g' \
|
|
|
|
-e 's/hsOfficePartner/hsOfficeRelationship/g' \
|
|
|
|
-e 's/partner/relationship/g' \
|
|
|
|
\
|
|
|
|
-e 's/addPartner/addRelationship/g' \
|
|
|
|
-e 's/listPartners/listRelationships/g' \
|
|
|
|
-e 's/getPartnerByUuid/getRelationshipByUuid/g' \
|
|
|
|
-e 's/patchPartner/patchRelationship/g' \
|
|
|
|
-e 's/person/relHolder/g' \
|
|
|
|
-e 's/registrationOffice/relType/g' \
|
|
|
|
<$source >$target
|
|
|
|
|
|
|
|
done
|
2022-09-07 20:24:35 +02:00
|
|
|
|
2022-09-09 17:43:43 +02:00
|
|
|
exit
|
2022-09-07 20:24:35 +02:00
|
|
|
|
2022-09-07 14:04:45 +02:00
|
|
|
cat >>src/main/resources/db/changelog/db.changelog-master.yaml <<EOF
|
|
|
|
- include:
|
2022-09-26 10:57:22 +02:00
|
|
|
file: db/changelog/2X0-hs-office-$sourceLower.sql
|
2022-09-07 14:04:45 +02:00
|
|
|
- include:
|
2022-09-26 10:57:22 +02:00
|
|
|
file: db/changelog/2X3-hs-office-$sourceLower-rbac.sql
|
2022-09-07 14:04:45 +02:00
|
|
|
- include:
|
2022-09-26 10:57:22 +02:00
|
|
|
file: db/changelog/2X8-hs-office-$sourceLower-test-data.sql
|
2022-09-07 14:04:45 +02:00
|
|
|
EOF
|