Files
bflows-bandi-be/src/main/resources/db/changelog/db.changelog-1.0.0.xml
2024-10-03 14:53:17 +05:30

846 lines
38 KiB
XML

<?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-4.0.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.23.xsd">
<changeSet id="14-08-2024_1" author="Harish Bagora">
<createTable tableName="region">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="region_pkey"/>
</column>
<column name="region_name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="description" type="TEXT">
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="country" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="status" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="priority_area" type="VARCHAR(255)">
<constraints nullable="true"/>
</column>
<column name="population" type="INTEGER">
<constraints nullable="true"/>
</column>
<column name="area_size" type="numeric">
<constraints nullable="true"/>
</column>
<column name="gdp" type="numeric">
<constraints nullable="true"/>
</column>
<column name="unemployment_rate" type="numeric">
<constraints nullable="true"/>
</column>
<column name="infrastructure_score" type="numeric">
<constraints nullable="true"/>
</column>
<column name="education_level" type="numeric">
<constraints nullable="true"/>
</column>
<column name="healthcare_access" type="numeric">
<constraints nullable="true"/>
</column>
<column name="environmental_score" type="numeric">
<constraints nullable="true"/>
</column>
</createTable>
</changeSet>
<changeSet id="14-08-2024_2" author="Harish Bagora">
<createTable tableName="role">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="role_pkey"/>
</column>
<column name="role_name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="role_type" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(255)">
<constraints nullable="true"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="permissions" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="region_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_role_region" references="region(id)"/>
</column>
</createTable>
</changeSet>
<changeSet id="14-08-2024_3" author="Harish Bagora">
<createTable tableName="gepafin_user">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="gepafin_user_pkey"/>
</column>
<column name="password" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="email" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="first_name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="last_name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="phone_number" type="VARCHAR(255)"/>
<column name="role_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_gepafin_user_role" references="role(id)"/>
</column>
<column name="status" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="last_login" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="organization" type="TEXT">
<constraints nullable="true"/>
</column>
<column name="address" type="TEXT">
<constraints nullable="true"/>
</column>
<column name="city" type="TEXT">
<constraints nullable="true"/>
</column>
<column name="country" type="TEXT">
<constraints nullable="true"/>
</column>
</createTable>
</changeSet>
<changeSet id="21-08-2024_1" author="Rajesh Khore">
<createTable tableName="call">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="call_pkey"/>
</column>
<column name="name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="description_short" type="TEXT"/>
<column name="description_long" type="TEXT"/>
<column name="start_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="end_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="status" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="region_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_region_call" references="region(id)"/>
</column>
<column name="amount" type="numeric">
<constraints nullable="false"/>
</column>
<column name="amount_max" type="numeric">
<constraints nullable="false"/>
</column>
<column name="documentation_requested" type="TEXT"/>
<column name="contact_info" type="TEXT"/>
<column name="submission_method" type="TEXT">
</column>
<column name="threshold" type="INTEGER">
</column>
<column name="priority_area" type="TEXT"/>
<column name="confidi" type="BOOLEAN"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
</createTable>
<createTable tableName="evaluation_criteria">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="evaluation_criteria_pkey"/>
</column>
<column name="call_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_call_evaluation_criteria" references="call(id)"/>
</column>
<column name="name" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="description" type="TEXT"/>
<column name="score" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
</createTable>
<createTable tableName="faq">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="faq_pkey"/>
</column>
<column name="call_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_call_faq" references="call(id)"/>
</column>
<column name="user_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_gepafin_user_faq" references="gepafin_user(id)"/>
</column>
<column name="is_visible" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="question_short" type="VARCHAR(255)"/>
<column name="question" type="TEXT"/>
<column name="response_short" type="VARCHAR(255)"/>
<column name="response" type="TEXT"/>
<column name="response_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
</createTable>
<createTable tableName="document">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="document_pkey"/>
</column>
<column name="file_name" type="VARCHAR(255)">
</column>
<column name="file_path" type="TEXT"/>
<column name="call_id" type="INTEGER">
<constraints foreignKeyName="fk_call_document" references="call(id)"/>
</column>
<column name="description" type="TEXT"/>
<column name="type" type="VARCHAR(255)">
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="lookup_data">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="lookup_data_pkey"/>
</column>
<column name="title" type="VARCHAR(255)">
<constraints nullable="true"/>
</column>
<column name="type" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="value" type="TEXT">
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="call_target_audience_checklist">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="call_target_audience_checklist_pkey"/>
</column>
<column name="call_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_call_call_target_audience_checklist" references="call(id)"/>
</column>
<column name="lookup_data_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_lookup_data_call_target_audience_checklist" references="lookup_data(id)"/>
</column>
<column name="is_validated" type="BOOLEAN">
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
</changeSet>
<changeSet id="22-08-2024_1" author="Harish Bagora">
<insert tableName="region">
<column name="region_name" value="Italy"/>
<column name="description" value="A beautiful country in Southern Europe known for its art, culture, and history."/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="country" value="Italy"/>
<column name="status" value="ACTIVE"/>
<column name="priority_area" value="Tourism"/>
<column name="population" value="60000000"/>
<column name="area_size" value="301340"/>
<column name="gdp" value="2000000"/>
<column name="unemployment_rate" value="8.3"/>
<column name="infrastructure_score" value="85"/>
<column name="education_level" value="78"/>
<column name="healthcare_access" value="88"/>
<column name="environmental_score" value="75"/>
</insert>
</changeSet>
<changeSet id="22-08-2024_2" author="Harish Bagora">
<!-- Insert data for Beneficiaries role -->
<insert tableName="role">
<column name="role_name" value="beneficiary"/>
<column name="role_type" value="ROLE_BENEFICIARY"/>
<column name="description" value="Companies or individuals looking for financing opportunities. They can view, search, and apply to available calls."/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="permissions" value="VIEW_CALLS, APPLY_CALLS"/>
<column name="region_id" valueComputed="1"/>
</insert>
<!-- Insert data for Super Admin role -->
<insert tableName="role">
<column name="role_name" value="super admin"/>
<column name="role_type" value="ROLE_SUPER_ADMIN"/>
<column name="description" value="Manages the creation and publication of tenders and administers internal system users."/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="permissions" value="MANAGE_TENDERS, MANAGE_USERS"/>
<column name="region_id" valueComputed="1"/>
</insert>
<!-- Insert data for Pre-instructors role -->
<insert tableName="role">
<column name="role_name" value="pre instructor"/>
<column name="role_type" value="ROLE_PRE_INSTRUCTOR"/>
<column name="description" value="They evaluate the applications sent by beneficiaries and manage the preliminary relief process."/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="permissions" value="EVALUATE_APPLICATIONS, MANAGE_PRELIMINARY_RELIEF"/>
<column name="region_id" valueComputed="1"/>
</insert>
<!-- Insert data for Gepafin Operators role -->
<insert tableName="role">
<column name="role_name" value="gepafin operator"/>
<column name="role_type" value="ROLE_GEPAFIN_OPERATOR"/>
<column name="description" value="They manage the subsequent phases of the evaluation after the pre-investigation."/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="permissions" value="MANAGE_SUBSEQUENT_PHASES"/>
<column name="region_id" valueComputed="1"/>
</insert>
</changeSet>
<changeSet id="22-08-2024_3" author="Harish Bagora">
<!-- Insert Super User -->
<insert tableName="gepafin_user">
<column name="password" value="$2a$10$doUyOcEm8WPuFfpFT5y18.1DvZzF7exbqgy9X0P27cUBK7YWbfzzS"/>
<column name="email" value="superUser@test.test"/>
<column name="first_name" value="Super"/>
<column name="last_name" value="User"/>
<column name="phone_number" value="1234567890"/>
<column name="role_id" valueComputed="2"/>
<column name="status" value="ACTIVE"/>
<column name="last_login" value="2024-08-14 00:00:00"/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="organization" value="SuperOrg"/>
<column name="address" value="123 Main Street"/>
<column name="city" value="Rome"/>
<column name="country" value="Italy"/>
</insert>
<!-- Insert Beneficiary User -->
<insert tableName="gepafin_user">
<column name="password" value="$2a$10$doUyOcEm8WPuFfpFT5y18.1DvZzF7exbqgy9X0P27cUBK7YWbfzzS"/>
<column name="email" value="test@test.test"/>
<column name="first_name" value="Test"/>
<column name="last_name" value="User"/>
<column name="phone_number" value="0987654321"/>
<column name="role_id" valueComputed="1"/>
<column name="status" value="ACTIVE"/>
<column name="last_login" value="2024-08-14 00:00:00"/>
<column name="created_date" value="2024-08-14 00:00:00"/>
<column name="updated_date" value="2024-08-14 00:00:00"/>
<column name="organization" value="TestOrg"/>
<column name="address" value="456 Market Street"/>
<column name="city" value="Milan"/>
<column name="country" value="Italy"/>
</insert>
</changeSet>
<changeSet id="29-08-2024_1" author="Rajesh Khore">
<createTable tableName="form">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="form_pkey"/>
</column>
<column name="label" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="call_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_call_form" references="call(id)"/>
</column>
<column name="content" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="order_no" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="form_template">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="form_template_pkey"/>
</column>
<column name="label" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="content" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="form_field">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="form_field_pkey"/>
</column>
<column name="name" type="VARCHAR(255)">
<constraints nullable="true"/>
</column>
<column name="label" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="settings" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="validators" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
</changeSet>
<changeSet id="27-08-2024_1" author="Rajesh Khore">
<dropColumn tableName="EVALUATION_CRITERIA"
columnName="name" />
<dropColumn tableName="EVALUATION_CRITERIA"
columnName="description" />
<addColumn tableName="EVALUATION_CRITERIA">
<column name="lookup_data_id" type="INTEGER">
<constraints nullable="false"
foreignKeyName="fk_lookup_data_evaluation_criteria"
references="lookup_data(id)" />
</column>
</addColumn>
</changeSet>
<changeSet id="27-08-2024_2" author="Rajesh Khore">
<addColumn tableName="FAQ">
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
</addColumn>
<addColumn tableName="CALL_TARGET_AUDIENCE_CHECKLIST">
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
</addColumn>
<addColumn tableName="EVALUATION_CRITERIA">
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
</addColumn>
<addColumn tableName="DOCUMENT">
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
<changeSet id="23-08-2024_1" author="Harish Bagora">
<addColumn tableName="gepafin_user">
<column name="reset_password_token" type="VARCHAR(255)">
<constraints nullable="true"/>
</column>
</addColumn>
</changeSet>
<changeSet id="30-08-2024_1" author="Rajesh Khore">
<sqlFile dbms="postgresql"
path="db/dump/inserted_form_field_data_30_08_2024.sql" />
<sql dbms="postgresql">select
setval('gepafin_schema.form_field_id_seq', (select
max(id)+1
from gepafin_schema.form_field), false)
</sql>
</changeSet>
<changeSet id="27-08-2024_3" author="Rajesh Khore">
<dropNotNullConstraint tableName="call" columnName="name"/>
<dropNotNullConstraint tableName="call" columnName="start_date"/>
<dropNotNullConstraint tableName="call" columnName="end_date"/>
<dropNotNullConstraint tableName="call" columnName="status"/>
<dropNotNullConstraint tableName="call" columnName="region_id"/>
<dropNotNullConstraint tableName="call" columnName="amount"/>
<dropNotNullConstraint tableName="call" columnName="amount_max"/>
</changeSet>
<changeSet id="29-08-2024_1" author="Harish Bagora">
<addColumn tableName="FAQ">
<column name="lookup_data_id" type="INTEGER">
<constraints nullable="false"
foreignKeyName="fk_lookup_data_faq"
references="lookup_data(id)" />
</column>
</addColumn>
</changeSet>
<changeSet id="02-09-2024_1" author="Rajesh Khore">
<dropColumn tableName="FORM"
columnName="order_no" />
</changeSet>
<changeSet id="03-09-2024_1" author="Rajesh Khore">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="db/dump/update_form_field_data_04_09_2024.sql" />
</changeSet>
<changeSet id="04-09-2024_1" author="Rajesh Khore">
<dropColumn tableName="FAQ" columnName="question_short" />
<dropColumn tableName="FAQ" columnName="question" />
<dropColumn tableName="FAQ" columnName="response_short" />
<dropColumn tableName="FAQ" columnName="lookup_data_id" />
<addColumn tableName="FAQ">
<column name="title" type="TEXT"/>
<column name="value" type="TEXT"/>
</addColumn>
<addColumn tableName="LOOKUP_DATA">
<column name="response" type="TEXT"/>
</addColumn>
<modifyDataType tableName="LOOKUP_DATA" columnName="title" newDataType="TEXT"/>
</changeSet>
<changeSet id="09-09-2024_2" author="Harish Bagora">
<renameColumn tableName="document" oldColumnName="call_id" newColumnName="source_id" columnDataType="BIGINT"/>
<addColumn tableName="document">
<column name="source" type="VARCHAR(255)"/>
</addColumn>
<dropColumn tableName="document" columnName="description"/>
<dropForeignKeyConstraint baseTableName="document" constraintName="fk_call_document"/>
</changeSet>
<changeSet id="09-09-2024_1" author="Rajesh Khore">
<createTable tableName="application_form">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="application_form_pkey"/>
</column>
<column name="form_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_form_application_form" references="form(id)"/>
</column>
<column name="order_no" type="VARCHAR(255)"></column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="application_form_field">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="application_form_field_pkey"/>
</column>
<column name="application_form_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_application_form_application_form_field" references="application_form(id)"/>
</column>
<column name="field_id" type="VARCHAR(255)" ></column>
<column name="field_value" type="VARCHAR(255)"></column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="flow_edges">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="flow_edges_pkey"/>
</column>
<column name="call_id" type="INTEGER">
</column>
<column name="source_id" type="INTEGER"></column>
<column name="target_id" type="INTEGER"></column>
<column name="type" type="VARCHAR(255)"></column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<createTable tableName="flow_data">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="flow_data_pkey"/>
</column>
<column name="call_id" type="INTEGER">
</column>
<column name="form_id" type="INTEGER"></column>
<column name="choosen_field" type="VARCHAR(255)"></column>
<column name="choosen_value" type="VARCHAR(255)"></column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<addColumn tableName="call">
<column name="initial_form" type="INTEGER"></column>
<column name="final_form" type="INTEGER"></column>
</addColumn>
</changeSet>
<changeSet id="11-09-2024_1" author="Rajesh Khore">
<createTable tableName="application">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true" primaryKeyName="application_pkey"/>
</column>
<column name="user_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_user_application" references="gepafin_user(id)"/>
</column>
<column name="submission_date" type="TIMESTAMP WITHOUT TIME ZONE"></column>
<column name="status" type="VARCHAR(255)"></column>
<column name="comments" type="TEXT"></column>
<column name="call_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_call_application" references="call(id)"/>
</column>
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/></column>
</createTable>
<addColumn tableName="application_form">
<column name="application_id" type="INTEGER">
<constraints nullable="false" foreignKeyName="fk_application_application_form" references="application(id)"/>
</column>
</addColumn>
<dropColumn tableName="application_form">
<column name="order_no" type="VARCHAR(255)"></column>
</dropColumn>
</changeSet>
<changeSet id="13-09-2024_1" author="Harish Bagora">
<addColumn tableName="form_field">
<column name="description" type="TEXT">
<constraints nullable="true"/>
</column>
<column name="sort_order" type="INTEGER">
<constraints nullable="true"/>
</column>
</addColumn>
</changeSet>
<changeSet id="13-09-2024_2" author="Harish Bagora">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="classpath:db/dump/inserted_form_field_data_13_09_2024.sql" />
</changeSet>
<changeSet id="12-09-2024_1" author="Rajesh Khore">
<addColumn tableName="flow_edges">
<column name="tracking_id" type="VARCHAR(255)"></column>
</addColumn>
</changeSet>
<changeSet id="16-09-2024_1" author="Harish Bagora">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_16-09-2024.sql" />
</changeSet>
<changeSet id="23-09-2024_1" author="Rajesh Khore">
<createTable tableName="saml_response">
<column name="id" type="INTEGER" autoIncrement="true"></column>
<column name="authentication_object" type="TEXT"> </column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"></column>
<column name="token" type="varchar(255)"></column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</createTable>
</changeSet>
<changeSet id="25-09-2024_2" author="Nisha kashyap">
<update tableName="form_field">
<column name="name" value="textinput" />
<where>id = 13</where>
</update>
</changeSet>
<changeSet id="25-09-2024_1" author="Rajesh Khore">
<addColumn tableName="gepafin_user">
<column name="codice_fiscale" type="varchar(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="date_of_birth" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</addColumn>
<dropNotNullConstraint tableName="gepafin_user" columnName="password"/>
</changeSet>
<changeSet id="27-09-2024_1" author="Rajesh Khore">
<createTable tableName="beneficiary">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="beneficiary_pkey" />
</column>
<column name="EMAIL" type="VARCHAR(255)" />
<column name="FIRST_NAME" type="VARCHAR(255)" />
<column name="LAST_NAME" type="VARCHAR(255)" />
<column name="PHONE_NUMBER" type="VARCHAR(255)" />
<column name="ORGANIZATION" type="TEXT" />
<column name="ADDRESS" type="TEXT" />
<column name="CITY" type="TEXT" />
<column name="COUNTRY" type="TEXT" />
<column name="CODICE_FISCALE" type="varchar(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="DATE_OF_BIRTH" type="TIMESTAMP" />
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
<dropColumn tableName="gepafin_user" columnName="codice_fiscale"/>
<dropNotNullConstraint tableName="gepafin_user" columnName="first_name"/>
<dropNotNullConstraint tableName="gepafin_user" columnName="last_name"/>
<addColumn tableName="gepafin_user">
<column name="beneficiary_id" type="INTEGER">
<constraints nullable="true" foreignKeyName="fk_beneficiary_gepafin_user" references="beneficiary(id)"/>
</column>
</addColumn>
</changeSet>
<changeSet id="27-09-2024_2" author="Rajesh Khore">
<createTable tableName="COMPANY">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="company_pkey" />
</column>
<column name="COMPANY_NAME" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="VAT_NUMBER" type="VARCHAR(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="CODICE_FISCALE" type="VARCHAR(255)"/>
<column name="ADDRESS" type="VARCHAR(255)"/>
<column name="PHONE_NUMBER" type="VARCHAR(255)"/>
<column name="CITY" type="VARCHAR(255)"/>
<column name="PROVINCE" type="VARCHAR(255)"/>
<column name="CAP" type="VARCHAR(255)"/>
<column name="COUNTRY" type="VARCHAR(255)"/>
<column name="PEC" type="VARCHAR(255)"/>
<column name="EMAIL" type="VARCHAR(255)"/>
<column name="NUMBER_OF_EMPLOYEES" type="VARCHAR(255)"/>
<column name="ANNUAL_REVENUE" type="NUMERIC"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
</changeSet>
<changeSet id="27-09-2024_3" author="Rajesh Khore">
<createTable tableName="USER_WITH_COMPANY">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="user_with_company_pkey" />
</column>
<column name="USER_ID" type="INTEGER"/>
<column name="BENEFICIARY_ID" type="INTEGER"/>
<column name="COMPANY_ID" type="INTEGER"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
</changeSet>
<changeSet id="27-09-2024_4" author="Rajesh Khore">
<addColumn tableName="APPLICATION">
<column name="COMPANY_ID" type="INTEGER">
<constraints nullable="true" foreignKeyName="fk_COMPANY_APPLICATION" references="company(id)"/>
</column>
</addColumn>
<addColumn tableName="FAQ">
<column name="COMPANY_ID" type="INTEGER"/>
</addColumn>
</changeSet>
<changeSet id="01-10-2024_1" author="Nisha Kashyap">
<addColumn tableName="call">
<column name="amount_min" type="numeric"></column>
<column name="phone_number" type="VARCHAR(255)"></column>
<column name="email" type="VARCHAR(255)"></column>
<column name="end_time" type="TIME"></column>
<column name="start_time" type="TIME"></column>
</addColumn>
</changeSet>
<changeSet id="03-10-2024_1" author="Nisha Kashyap">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_03-10-2024.sql" />
</changeSet>
</databaseChangeLog>