<?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 User.
        Add flags for allowUserPwdAuth & allowSamlAuth
    -->
    <changeSet id="20250604123000-1" author="omg">
    	<!-- User can authenticate with USER+PWD -->
	    <addColumn tableName="jhi_user">
	        <column name="allow_user_pwd_auth" type="boolean" valueBoolean="false"/>
	    </addColumn>
	    
	    <!-- User can authenticate with IDP (SAML2) -->
	    <addColumn tableName="jhi_user">
	        <column name="allow_saml_auth" type="boolean" valueBoolean="false"/>
	    </addColumn>
    </changeSet>
    
    <changeSet id="20250604123000-2" author="omg">
    	<!-- Update allow_user_pwd_auth to TRUE -->
    	<update tableName="jhi_user">
	        <column name="allow_user_pwd_auth" valueBoolean="true"/>
	    </update>
    </changeSet>
</databaseChangeLog>
