[IMP] add bdd manipulation to migrate credit.request

due to account.invoice transformation in account.move
This commit is contained in:
Stéphan Sainléger
2025-03-27 09:14:17 +01:00
parent 5feebec210
commit ddb1fcd0ad
2 changed files with 31 additions and 0 deletions

View File

@@ -17,6 +17,20 @@ EOF
)
query_postgres_container "$PRE_MIGRATE_SQL" ou13 || exit 1
# Digital currency specific - to comment if not needed
INVOICE_NAME_SQL=$(cat <<'EOF'
ALTER TABLE credit_request ADD invoice_name VARCHAR;
UPDATE credit_request
SET invoice_name = (
SELECT move_name
FROM account_invoice
WHERE account_invoice.id = credit_request.invoice_id
);
UPDATE credit_request SET invoice_id = NULL;
EOF
)
query_postgres_container "$INVOICE_NAME_SQL" ou13 || exit 1
# Copy filestores
copy_filestore ou12 ou12 ou13 ou13 || exit 1

View File

@@ -0,0 +1,17 @@
#!/bin/bash
echo "POST migration to 16.0..."
# Digital currency specific - to comment if not needed
INVOICE_NAME_SQL=$(cat <<'EOF'
UPDATE credit_request
SET invoice_id = (
SELECT id
FROM account_move
WHERE account_move.name = credit_request.invoice_name
);
EOF
)
query_postgres_container "$INVOICE_NAME_SQL" ou16 || exit 1
echo "END POST migration to 16.0."