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

    <!--
        Alter the entity OutputData.
        Add column Owner
    -->
    <changeSet id="20241206212207-1" author="omg">
	    <addColumn tableName="output_data">
	        <column name="owner_id" type="bigint">
	        	<constraints nullable="false" />
	        </column>
	    </addColumn>
    </changeSet>
    
    <changeSet id="20241206212207-2" author="omg">
        <addForeignKeyConstraint baseColumnNames="owner_id"
                             baseTableName="output_data"
                             constraintName="fk_output_data__owner_id"
                             referencedColumnNames="id"
                             referencedTableName="organization"
                             />
    </changeSet>
</databaseChangeLog>
