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

DAT-18148: refactorings + tests #175

Merged
merged 7 commits into from
Sep 10, 2024
Merged

DAT-18148: refactorings + tests #175

merged 7 commits into from
Sep 10, 2024

Conversation

filipelautert
Copy link
Contributor

@filipelautert filipelautert commented Aug 26, 2024

The following changeset will create auto increment/generated columns:

    <changeSet author="testuser" id="4">
        <createTable tableName="tableac" >
            <column name="longcolumn" type="long" autoIncrement="true" generationType="IDENTITY" />
            <column name="eventTime" type="timestamp"/>
            <column name="year" type="int" defaultValueComputed="GENERATED ALWAYS AS (YEAR(eventTime))"/>
            <column name="eventDate" type="date" defaultValueComputed="GENERATED ALWAYS AS (CAST(eventTime AS DATE))" />
            <column name="eventDescription" type="string">
                <constraints nullable="false" />
            </column>
            <column name="eventShortDescription" type="string" defaultValueComputed="GENERATED ALWAYS AS (SUBSTRING(eventDescription, 0, 1))" />
        </createTable>
    </changeSet>
    <changeSet id="5" author="filipe">
        <insert tableName="tableac">
            <column name="eventTime" value="2022-01-01 00:00:00"/>
            <column name="eventDescription" value="My first event"/>
        </insert>
    </changeSet>

Nothing was required on databricks side, please see companion PR in core: liquibase/liquibase#6263

@filipelautert filipelautert marked this pull request as ready for review August 26, 2024 21:28
@filipelautert filipelautert marked this pull request as draft August 27, 2024 12:00
@filipelautert filipelautert marked this pull request as draft August 27, 2024 12:00
@filipelautert filipelautert self-assigned this Aug 27, 2024
@filipelautert filipelautert marked this pull request as ready for review August 27, 2024 12:56
@filipelautert filipelautert changed the title feat[DAT-18148]: add support to auto-increment/generated columns feat[DAT-18148]: refactorings Aug 27, 2024
@filipelautert filipelautert changed the title feat[DAT-18148]: refactorings DAT-18148: refactorings Aug 27, 2024
@filipelautert filipelautert marked this pull request as draft August 27, 2024 13:39
@filipelautert filipelautert changed the title DAT-18148: refactorings DAT-18148: refactorings + tests Aug 27, 2024
@filipelautert filipelautert marked this pull request as ready for review August 27, 2024 20:38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ChangeObjectTests require to have the expectedSnapshot file to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the checkboxes are green, there are failed tests https://github.com/liquibase/liquibase-databricks/pull/175/checks?check_run_id=29317521268

Does the workflow have errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expectedSql file is there... but the SQL is incorrect because we depend on the core fix .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About expectedSnapshots: I used createTableDataTypeText.xml as an example and there is no expectedSnapshot to it, just sql... weird

@vitaliimak
Copy link
Contributor

@filipelautert
If you add an empty expectedSnapshot JSON file then the test will pass after the core change.
image

@filipelautert
Copy link
Contributor Author

If you add an empty expectedSnapshot JSON file then the test will pass after the core change.

Thanks @vitaliimak , I just pushed an empty one.

Copy link

sonarcloud bot commented Sep 10, 2024

@KushnirykOleh KushnirykOleh merged commit 6099eac into main Sep 10, 2024
14 of 15 checks passed
@KushnirykOleh KushnirykOleh deleted the DAT-18148 branch September 10, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants