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

Exporting all triggers when using include-tables #32

Open
juppwerner opened this issue Nov 14, 2023 · 1 comment
Open

Exporting all triggers when using include-tables #32

juppwerner opened this issue Nov 14, 2023 · 1 comment

Comments

@juppwerner
Copy link

Hello,

I am crossposting this issue here, too, because i just realized that the original repository is stale.

I have skip-triggers set to false.
I am also using include-tables to only select some tables to be dumped.

I expect to only get the CREATE TRIGGERs related to the included tables. But all triggers get exported.

I believe a fix could something like this:

public function getDatabaseStructureTriggers()
{
// Listing all triggers from database
if (false === $this->dumpSettings['skip-triggers']) {
foreach ($this->dbHandler->query($this->typeAdapter->show_triggers($this->dbName)) as $row) {
if(in_array($row['Table'], $this->dumpSettings['include-views']))
array_push($this->triggers, $row['Trigger']);
}
}
return;
}
Thank you.

Regards
Joachim

@back-2-95
Copy link
Member

Hello,

Could you create a PR ? I'm not super duper SQL expert so PRs run against the tests are very helpful.

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

No branches or pull requests

2 participants