-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add ability to set index names #6552
Conversation
This is a bug fix. |
@phpstan-var array|array{fields: string[], keyName: string} |
ec2e48d
to
dae7496
Compare
I think I have it straightened out now. |
Not the fault of this PR, but there are PHPStan errors.
|
bed68af
to
caf876b
Compare
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.
LGTM!
…nd Sqlite Forgot to commit this in smaller steps..
Some keys such as unique indexes are created as constraints. This looks to see if there is a constraint by the index name. If there is then we will drop constraint else we drop index.
Same as oracle - this looks up if key is a constraint
Have to lookup if key is constraint.
Get rid of CPD error
Co-authored-by: kenjis <[email protected]>
caf876b
to
0627627
Compare
@codeigniter4/database-team |
@sclubricants Thank you! |
🏆 |
Closes #5075
This PR allows setting the index name.
While testing dropping by the same name I discovered that
dropKey()
was generating errors when dropping a unique index be several of the DBMS. The reason is that some DBMS requireDROP CONSTRAINT
command rather thanDROP INDEX
. I did some extra work to getdropKey()
to work properly.MySql and SQLite don't really require a name for Primary Key - though Mysql allows setting the name. When dropping its as simple as
DROP PRIMARY KEY
.Checklist: