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

Drop constraint quota_definitions_name_key #3952

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kathap
Copy link
Contributor

@kathap kathap commented Sep 4, 2024

This PR waits for issue #3949, if support for Mysql5.7 will be stopped.

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:

    create_table :quota_definitions do
      VCAP::Migration.common(self, :qd)

      String :name, null: false, unique: true, case_insensitive: true
      Boolean :non_basic_services_allowed, null: false
      Integer :total_services, null: false
      Integer :memory_limit, null: false

      index :name, unique: true
    end

The unique: true in line String :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 branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

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.
stephanme added a commit that referenced this pull request Oct 11, 2024
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.

1 participant