Skip to content

Commit 9889069

Browse files
committed
Update build for cipherstash-encrypt.sql to not include ALTER DOMAIN statements at top of file
These were causing cipherstash-encrypt.sql to fail if the domains being altered didn't already exist. Instead, only include `ALTER DOMAIN` statements at the top of the uninstall script.
1 parent 3766a28 commit 9889069

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

justfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,33 @@ build:
3232

3333
# Collect all the drops
3434
# In reverse order (tac) so that we drop the constraints before the tables
35-
grep -h -E '^(DROP|ALTER DOMAIN [^ ]+ DROP CONSTRAINT)' sql/0*-*.sql | tac > release/cipherstash-encrypt-tmp-drop.sql
35+
grep -h -E '^(DROP)' sql/0*-*.sql | tac > release/cipherstash-encrypt-tmp-drop-install.sql
3636
# types are always last
37-
cat sql/666-drop_types.sql >> release/cipherstash-encrypt-tmp-drop.sql
37+
cat sql/666-drop_types.sql >> release/cipherstash-encrypt-tmp-drop-install.sql
3838

3939

4040
# Build cipherstash-encrypt.sql
4141
# drop everything first
42-
cat release/cipherstash-encrypt-tmp-drop.sql > release/cipherstash-encrypt.sql
42+
cat release/cipherstash-encrypt-tmp-drop-install.sql > release/cipherstash-encrypt.sql
4343
# cat the rest of the sql files
4444
cat sql/0*-*.sql >> release/cipherstash-encrypt.sql
4545

46+
# Collect all the drops
47+
# In reverse order (tac) so that we drop the constraints before the tables
48+
grep -h -E '^(DROP|ALTER DOMAIN [^ ]+ DROP CONSTRAINT)' sql/0*-*.sql | tac > release/cipherstash-encrypt-tmp-drop-uninstall.sql
49+
# types are always last
50+
cat sql/666-drop_types.sql >> release/cipherstash-encrypt-tmp-drop-uninstall.sql
51+
4652

4753
# Build cipherstash-encrypt-uninstall.sql
4854
# prepend the drops to the main sql file
49-
cat release/cipherstash-encrypt-tmp-drop.sql >> release/cipherstash-encrypt-uninstall.sql
55+
cat release/cipherstash-encrypt-tmp-drop-uninstall.sql >> release/cipherstash-encrypt-uninstall.sql
5056
# uninstall renames configuration table
5157
cat sql/666-rename_configuration_table.sql >> release/cipherstash-encrypt-uninstall.sql
5258

5359
# remove the drop file
54-
rm release/cipherstash-encrypt-tmp-drop.sql
60+
rm release/cipherstash-encrypt-tmp-drop-install.sql
61+
rm release/cipherstash-encrypt-tmp-drop-uninstall.sql
5562

5663

5764
reset:

0 commit comments

Comments
 (0)