<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

	<property name="blobType" value="LONGBLOB"/>

    <!--
        Added the entity Document.
    -->
    <changeSet id="20250414100000-1" author="jhipster">
        <createTable tableName="document" remarks="Support documents (attach's) to download by the user.">
            <column name="id" type="bigint" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="title" type="varchar(255)" remarks="A simple and small text with a title, for human reference and better relation">
                <constraints nullable="false" />
            </column>
            <column name="description" type="varchar(255)" remarks="An optional additional description">
                <constraints nullable="true" />
            </column>
            <column name="data_file" type="${blobType}" remarks="The uploaded file, usually a PDF.">
                <constraints nullable="false" />
            </column>
            <column name="data_file_content_type" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
                <constraints nullable="false" />
            </column>
        </createTable>
    </changeSet>
</databaseChangeLog>
