minor fixes
This commit is contained in:
@@ -1,8 +1,62 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
<changeSet author="khoza (generated)" id="1781993557092-7">
|
||||
<addColumn tableName="group_batch_item">
|
||||
<column name="recipient_account" type="varchar(255)"/>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-9">
|
||||
<createIndex indexName="IX_charge_exclude_productsPK" tableName="charge_exclude_products" unique="true">
|
||||
<column name="charge_id"/>
|
||||
<column name="charge_condition_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-10">
|
||||
<createIndex indexName="IX_charge_include_productsPK" tableName="charge_include_products" unique="true">
|
||||
<column name="charge_id"/>
|
||||
<column name="charge_condition_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-11">
|
||||
<createIndex indexName="IX_workspace_usersPK" tableName="workspace_users" unique="true">
|
||||
<column name="workspace_id"/>
|
||||
<column name="user_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-1">
|
||||
<dropPrimaryKey tableName="charge_exclude_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-2">
|
||||
<addPrimaryKey columnNames="charge_id, charge_condition_id" constraintName="charge_exclude_productsPK" tableName="charge_exclude_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-3">
|
||||
<dropPrimaryKey tableName="charge_include_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-4">
|
||||
<addPrimaryKey columnNames="charge_id, charge_condition_id" constraintName="charge_include_productsPK" tableName="charge_include_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-5">
|
||||
<dropPrimaryKey tableName="workspace_users"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-6">
|
||||
<addPrimaryKey columnNames="workspace_id, user_id" constraintName="workspace_usersPK" tableName="workspace_users"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza" id="convert-party-type-to-string">
|
||||
<comment>Convert party_type column from integer ordinal to string enum values to match @Enumerated(EnumType.STRING) in Transaction.java</comment>
|
||||
|
||||
<!-- Add a temporary VARCHAR column -->
|
||||
<addColumn tableName="transaction">
|
||||
<column name="party_type_str" type="VARCHAR(20)">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
|
||||
<!-- Convert existing ordinal integer values (0=INDIVIDUAL, 1=GROUP, 2=BATCH) to strings -->
|
||||
<sql>
|
||||
UPDATE transaction SET party_type_str = 'INDIVIDUAL' WHERE party_type = 0 OR party_type = '0';
|
||||
UPDATE transaction SET party_type_str = 'GROUP' WHERE party_type = 1 OR party_type = '1';
|
||||
UPDATE transaction SET party_type_str = 'BATCH' WHERE party_type = 2 OR party_type = '2';
|
||||
</sql>
|
||||
|
||||
<!-- Drop old integer column -->
|
||||
<dropColumn tableName="transaction" columnName="party_type"/>
|
||||
|
||||
<!-- Rename temp column to original name -->
|
||||
<renameColumn tableName="transaction" oldColumnName="party_type_str" newColumnName="party_type"/>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
Reference in New Issue
Block a user