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

Fix #1080: Protection against duplicate entries in the pa_operation_template table #1091

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

jnpsk
Copy link
Collaborator

@jnpsk jnpsk commented Oct 24, 2023

Fix #1080

  • OperationTemplateEntity.templateName set to unique
  • Created liquibase changeset
  • Tests

@jnpsk jnpsk requested a review from banterCZ October 24, 2023 12:26
Copy link
Member

@banterCZ banterCZ left a comment

Choose a reason for hiding this comment

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

Let's move the liquibase to the next version, please. Otherwise good job.

@jnpsk jnpsk requested a review from banterCZ October 24, 2023 14:44
@banterCZ banterCZ requested a review from romanstrobl October 25, 2023 06:27
</not>
</preConditions>
<comment>Add unique constraint to pa_operation_template.template_name</comment>
<addUniqueConstraint tableName="pa_operation_template" columnNames="template_name" constraintName="pa_operation_template_template_name_uk" />
Copy link
Member

Choose a reason for hiding this comment

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

@zcgandcomp Should we keep recording the db changes also in the migration guides or not?

Copy link
Member

Choose a reason for hiding this comment

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

We should add information into the migration guide, please add this information in the usual way as seen in previous migration guides.

Copy link
Member

Choose a reason for hiding this comment

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

Should we be concrete about the changes or just mention that some changes are needed and link a script, which will be generated during the release?

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/wultra/development-internal/wiki/Using-Liquibase#13-migration-between-versions. Yes please add a migration guide and mention the change. In theory it is possible to have (invalid) duplicities in the DB. The migration script in SQL will be generated during release procedure.

Copy link
Member

@romanstrobl romanstrobl left a comment

Choose a reason for hiding this comment

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

NIce improvement, however we should also add step to the migration guide. We should also document how to proceed in case addition of the unique constraint fails.

</not>
</preConditions>
<comment>Add unique constraint to pa_operation_template.template_name</comment>
<addUniqueConstraint tableName="pa_operation_template" columnNames="template_name" constraintName="pa_operation_template_template_name_uk" />
Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/wultra/development-internal/wiki/Using-Liquibase#13-migration-between-versions. Yes please add a migration guide and mention the change. In theory it is possible to have (invalid) duplicities in the DB. The migration script in SQL will be generated during release procedure.

@jnpsk jnpsk requested review from zcgandcomp and banterCZ October 30, 2023 08:32
Copy link
Member

@banterCZ banterCZ left a comment

Choose a reason for hiding this comment

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

The migration guide is good for me.

Copy link
Member

@zcgandcomp zcgandcomp left a comment

Choose a reason for hiding this comment

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

Looks OK.

@jnpsk jnpsk merged commit b7c0886 into develop Oct 31, 2023
5 checks passed
@jnpsk jnpsk deleted the issues/1080-operation-template-table-duplicate-entries branch October 31, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protection against duplicate entries in the pa_operation_template table
4 participants