Skip to content

Commit

Permalink
generated_by_script must not be null
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Dec 18, 2024
1 parent 5539f38 commit 33241d2
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<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-2.0.xsd">
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-2.0.xsd">

<changeSet author="Andrej Romanov" id="ADD-GENERATED-BY-SCRIPT-TO-PROFILE-EMAIL-DOMAIN-TABLE">
<preConditions onFail="MARK_RAN">
Expand All @@ -9,14 +9,24 @@
</not>
</preConditions>
<sql>ALTER TABLE profile_email_domain ADD generated_by_script boolean default false;</sql>
</changeSet>
</changeSet>

<changeSet author="Andrej Romanov" id="UPDATE-GENERATED-BY-SCRIPT-BASED-ON-CREATED-DATE" dbms="postgresql">
<sql>UPDATE profile_email_domain SET generated_by_script = true WHERE date_created &lt; '2024-10-28';</sql>
</changeSet>

<changeSet author="Angel Montenegro" id="SET-FALSE-TO-NULL" dbms="postgresql">
<changeSet author="Angel Montenegro" id="SET-FALSE-TO-NULL-VALUES" dbms="postgresql">
<sql>UPDATE profile_email_domain SET generated_by_script = false WHERE generated_by_script is null;</sql>
</changeSet>

</databaseChangeLog>
<changeSet author="Angel Montenegro" id="SET-FIELD-NOT-NULLABLE" dbms="postgresql">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="YES">select is_nullable from information_schema.columns where table_name = 'peer_review' and column_name = 'org_id';</sqlCheck>
</preConditions>
<addNotNullConstraint
columnName="generated_by_script"
tableName="profile_email_domain"
defaultNullValue="false"/>
</changeSet>

</databaseChangeLog>

0 comments on commit 33241d2

Please sign in to comment.