<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  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-4.27.xsd">

  <changeSet id="0001-1-extensions" author="ordinis" runAlways="true">
    <preConditions onFail="HALT">
      <sqlCheck expectedResult="t">
        SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'postgis')
      </sqlCheck>
      <sqlCheck expectedResult="t">
        SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'btree_gist')
      </sqlCheck>
    </preConditions>
    <comment>Verify required PostgreSQL extensions are present (created by CNPG initdb).</comment>
    <sql>SELECT 1;</sql>
  </changeSet>

</databaseChangeLog>
