Rename db tables to have pt in them so states for real cash and perf test cash don't get accidentally mixed up in the db

This commit is contained in:
Christian Sailer 2017-10-17 14:07:43 +01:00
parent 9a145a710a
commit afac8c5728
3 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ class CashSelectionH2Impl : CashSelection {
// the softLockReserve update will detect whether we try to lock states locked by others
val selectJoin = """
SELECT vs.transaction_id, vs.output_index, vs.contract_state, ccs.pennies, SET(@t, ifnull(@t,0)+ccs.pennies) total_pennies, vs.lock_id
FROM vault_states AS vs, contract_cash_states AS ccs
FROM vault_states AS vs, contract_pt_cash_states AS ccs
WHERE vs.transaction_id = ccs.transaction_id AND vs.output_index = ccs.output_index
AND vs.state_status = 0
AND ccs.ccy_code = '${amount.token}' and @t < ${amount.quantity}

View File

@ -22,7 +22,7 @@ object CashSchema
@CordaSerializable
object CashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) {
@Entity
@Table(name = "contract_cash_states",
@Table(name = "contract_pt_cash_states",
indexes = arrayOf(Index(name = "ccy_code_idx", columnList = "ccy_code"),
Index(name = "pennies_idx", columnList = "pennies")))
class PersistentCashState(

View File

@ -20,7 +20,7 @@ object CommercialPaperSchema
@CordaSerializable
object CommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
@Entity
@Table(name = "cp_states",
@Table(name = "cp_pt_states",
indexes = arrayOf(Index(name = "ccy_code_index", columnList = "ccy_code"),
Index(name = "maturity_index", columnList = "maturity_instant"),
Index(name = "face_value_index", columnList = "face_value")))