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

Adding methods to drop foreign,unique,primary,basic indexes #115

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

whizsid
Copy link

@whizsid whizsid commented Jan 8, 2022

No description provided.

src/Schema/Table.php Outdated Show resolved Hide resolved
*
* @return void
*/
public function dropPrimary($name)
Copy link
Member

Choose a reason for hiding this comment

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

Now there is no point in having these as they just call dropIndex anyway

/**
* Dropping a basic index from the table
*
* @param string|array $name Name of the index or column names associated with the index
Copy link
Member

Choose a reason for hiding this comment

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

string|string[]

$indexes = $this->table->getIndexes();

$matched = [];
foreach ($indexes as $key => $index) {
Copy link
Member

Choose a reason for hiding this comment

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

Do not validate indexes. Should crash when developer mistypes.

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.

2 participants