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 unique constraint using "alter table" #42840

Open
apantel opened this issue Nov 27, 2019 · 4 comments
Open

Drop unique constraint using "alter table" #42840

apantel opened this issue Nov 27, 2019 · 4 comments
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-anchored-telemetry The issue number is anchored by telemetry references.

Comments

@apantel
Copy link
Contributor

apantel commented Nov 27, 2019

ALTER TABLE DROP CONSTRAINT cannot be used to drop UNIQUE constraints. This is allowed through DROP INDEX CASCADE.

Epic: CRDB-10239

Jira issue: CRDB-5317

@apantel apantel added A-sql-pgcompat Semantic compatibility with PostgreSQL X-anchored-telemetry The issue number is anchored by telemetry references. labels Nov 27, 2019
@rafiss rafiss added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Oct 2, 2020
@rafiss
Copy link
Collaborator

rafiss commented Oct 2, 2020

Liquibase uses the alter table syntax to drop unique constraints.

@oneumyvakin
Copy link

oneumyvakin commented Oct 10, 2020

Laravel 7 Illuminate affected

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::table('settings', function (Blueprint $table) {
        $table->dropUnique('settings_name_unique');
        $table->string('group')->default('default');
});

@rafiss rafiss added this to Triage in SQL Sessions - Deprecated via automation Oct 22, 2020
@rafiss rafiss moved this from Triage to Shorter term backlog in SQL Sessions - Deprecated Oct 27, 2020
@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 12, 2021
@rafiss rafiss removed the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Nov 8, 2022
@rafiss rafiss removed this from Shorter term backlog in SQL Sessions - Deprecated Nov 8, 2022
@rafiss rafiss added this to Triage in SQL Foundations via automation Nov 8, 2022
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label Nov 8, 2022
@ajwerner
Copy link
Contributor

More cross-refs: #65885 #65929

@ajwerner
Copy link
Contributor

There was once upon a time, a half measure to allow this syntax for unique constraints which were not marked as "created explicitly" to be dropped in this way. It seems to have been removed at some point. My vote would be that we give up on this bookkeeping, or revive it, but either way, permit this syntax where it is reasonable.

@ajwerner ajwerner moved this from Triage to Backlog in SQL Foundations Nov 15, 2022
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-anchored-telemetry The issue number is anchored by telemetry references.
Projects
SQL Foundations
  
Backlog
Development

No branches or pull requests

4 participants