Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated by script must not be null #7159

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 'profile_email_domain' and column_name = 'generated_by_script';</sqlCheck>
</preConditions>
<addNotNullConstraint
columnName="generated_by_script"
tableName="profile_email_domain"
defaultNullValue="false"/>
</changeSet>

</databaseChangeLog>
Loading