<?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">

    <!--
        Added the entity DashboardComponent.
    -->
    <changeSet id="20250211161000-1" author="omg">
        <createTable tableName="dashboard_component" remarks="Dashboard Component\nDefines a name for a group of outputs, that will represent a output component to show in the dashboard.">
            <column name="id" type="bigint" autoIncrement="true" startWith="1">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="code" type="varchar(255)" remarks="User defined code. Must be unique.">
                <constraints nullable="false" unique="true" uniqueConstraintName="ux_dashboard_component__code" />
            </column>
            <column name="name" type="varchar(255)" remarks="The name of the DashboardComponent entry. Allows duplicate name&apos;s, but NOT duplicate code&apos;s.">
                <constraints nullable="false" />
            </column>
            <column name="description" type="varchar(255)" remarks="A more elaborate description of the DashboardComponent..">
                <constraints nullable="true" />
            </column>
            
            <column name="is_active" type="boolean">
                <constraints nullable="true" />
            </column>
            <column name="version" type="integer" defaultValueNumeric="-1" remarks="Record version for concurrency control.">
                <constraints nullable="false" />
            </column>
        </createTable>
    </changeSet>
</databaseChangeLog>
