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

Add ability to exclude tables from purge in ORM #225

Merged
merged 11 commits into from
Jul 5, 2016

Conversation

YaoOcelotl
Copy link
Contributor

Tests for the filter schema expression if present in the DBAL connection and checks is the table name has been explicitly excluded.

@@ -133,11 +142,15 @@ public function purge()
}

$connection = $this->em->getConnection();
$filterExpr = $connection->getConfiguration()->getFilterSchemaAssetsExpression();
$efe = empty($filterExpr);
Copy link
Member

Choose a reason for hiding this comment

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

What does efe mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Empty filter expression

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 abbreviate then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, i changed the variable name and added tests for exclusion using the filter expression or the explicit exclusion list.

@mikeSimonson
Copy link
Contributor

What I was trying to say was that because the filter schema option is available in the connection configuration, you won't see any of the tables that are filtered out by the connection.

Thus there is no point in adding that feature in all the app that use doctrine. It's already there.

@YaoOcelotl
Copy link
Contributor Author

YaoOcelotl commented Jun 16, 2016

The is filter expression regexp is used during create schema operations not during query's.

See setFilterSchemaAssetsExpression

@YaoOcelotl
Copy link
Contributor Author

YaoOcelotl commented Jun 16, 2016

The idea for using the filter expression regexp is that if tables/views should not be considered during schema creation they also should not be considered during schema purge.

As an example i use ^(?!view) to avoid overwriting view definitions.

@mikeSimonson
Copy link
Contributor

@YaoOcelotl Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants