-
Notifications
You must be signed in to change notification settings - Fork 361
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
Drop constraint quota_definitions_name_key #3923
Closed
kathap
wants to merge
12
commits into
main
from
remove-duplilcated-unique-constraint-from-quota-definitions
Closed
Drop constraint quota_definitions_name_key #3923
kathap
wants to merge
12
commits into
main
from
remove-duplilcated-unique-constraint-from-quota-definitions
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kathap
force-pushed
the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
from
August 8, 2024 12:40
cacc352
to
bf09cfd
Compare
5 tasks
svkrieger
requested changes
Aug 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add tests for the migration to make sure it does what it should and that it is idempotent?
Example: https://github.com/cloudfoundry/cloud_controller_ng/blob/main/spec/migrations/20240820070742_add_jobs_user_guid_state_index_spec.rb
db/migrations/20240808118000_drop_unique_constraint_quota_definitions_name_key.rb
Outdated
Show resolved
Hide resolved
db/migrations/20240808118000_drop_unique_constraint_quota_definitions_name_key.rb
Outdated
Show resolved
Hide resolved
db/migrations/20240808118000_drop_unique_constraint_quota_definitions_name_key.rb
Outdated
Show resolved
Hide resolved
kathap
force-pushed
the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
2 times, most recently
from
August 30, 2024 09:57
14c2f79
to
d4690fd
Compare
On the name column in quota_defintions there were two unique constraints/indexes. One unique index with name qd_name_index, which is similar in postgres and mysql, and then an unique constraint on column name with name in postgres=quota_definitions_name_key and name in mysql=name. Since the unique index already exists, we don't need the unique constraint. Dropping it with this migration.
kathap
force-pushed
the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
2 times, most recently
from
September 2, 2024 08:55
3c1d718
to
b310558
Compare
kathap
force-pushed
the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
from
September 2, 2024 09:07
b310558
to
a061f4a
Compare
kathap
force-pushed
the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
from
September 4, 2024 10:05
0848fd3
to
aa3a252
Compare
corrupt branch |
kathap
deleted the
remove-duplilcated-unique-constraint-from-quota-definitions
branch
September 5, 2024 07:14
svkrieger
pushed a commit
that referenced
this pull request
Oct 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On the name column in quota_defintions there were two unique constraints/indexes. One unique index with name qd_name_index, which is similar in postgres and mysql, and then an unique constraint on column name with name in postgres=
quota_definitions_name_key
and name in mysql=name
. These index/constraint are created during table creation:The
unique: true
in lineString :name, null: false, unique: true, case_insensitive: true
creates the unique constraint.Since there is an unique index created on column name
index :name, unique: true
(later renamed to qd_name_index), we don't need the unique constraint. Dropping it with this migration.I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests