<?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 EmissionFactor.
    -->
    <changeSet id="20241119003525-1" author="jhipster">
        <createTable tableName="emission_factor" remarks="Emission Factor">
            <column name="id" type="bigint" autoIncrement="true" startWith="1500">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="code" type="varchar(255)" remarks="Unique key, within the year">
                <constraints nullable="false" unique="true" uniqueConstraintName="ux_emission_factor__code" />
            </column>
            <column name="name" type="varchar(255)" remarks="The name or title for the Emission factor">
                <constraints nullable="false" />
            </column>
            <column name="unit" type="varchar(255)" remarks="The unit of the Emission Factor.">
                <constraints nullable="false" />
            </column>
            <column name="value" type="decimal(21,2)" remarks="The value of the factor.">
                <constraints nullable="false" />
            </column>
            <column name="source" type="varchar(255)" remarks="The source of the Emission Factor.">
                <constraints nullable="true" />
            </column>
            <column name="comments" type="varchar(255)" remarks="Comments">
                <constraints nullable="true" />
            </column>
            <column name="variable_scope_id" type="bigint">
                <constraints nullable="true" />
            </column>
            <column name="variable_category_id" type="bigint">
                <constraints nullable="true" />
            </column>
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
        </createTable>
    </changeSet>

    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->

</databaseChangeLog>
