mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
databaseChangeLog:
|
||
- changeSet:
|
||
id: 0010-drop-unique-tx-gateway
|
||
author: JJO
|
||
|
||
# ✅ Solo ejecuta el changeSet si existe la UNIQUE constraint
|
||
preConditions:
|
||
- onFail: MARK_RAN
|
||
- uniqueConstraintExists:
|
||
tableName: payment_transactions
|
||
constraintName: uq_tx_gateway_txid_type
|
||
|
||
changes:
|
||
# 1️⃣ Eliminar la UNIQUE constraint si existe
|
||
- dropUniqueConstraint:
|
||
tableName: payment_transactions
|
||
constraintName: uq_tx_gateway_txid_type
|
||
|
||
# 2️⃣ Crear un índice normal (no único) sobre gateway_transaction_id
|
||
- createIndex:
|
||
tableName: payment_transactions
|
||
indexName: idx_payment_tx_gateway_txid
|
||
columns:
|
||
- column:
|
||
name: gateway_transaction_id
|
||
|
||
rollback:
|
||
# 🔙 1) Eliminar el índice normal creado en este changeSet
|
||
- dropIndex:
|
||
tableName: payment_transactions
|
||
indexName: idx_payment_tx_gateway_txid
|
||
|
||
# 🔙 2) Restaurar la UNIQUE constraint original
|
||
- addUniqueConstraint:
|
||
tableName: payment_transactions
|
||
columnNames: gateway_transaction_id, type
|
||
constraintName: uq_tx_gateway_txid_type
|