-
Notifications
You must be signed in to change notification settings - Fork 418
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
Migrations cannot support mlutiple schemas #6
Comments
I'll take a crack at fixing this, if somebody can point me in the right direction. |
Look at PropelDatabaseComparator::compareTable(). I think it only compare table names, not schemas. |
Francois, Initially, looks like Database->hasTable() and getTable() should have some code like this: if ($this->schema && $this->getPlatform() && $this->getPlatform()->supportsSchemas()) {
$offset = strlen($this->schema)+1;
if ( substr(strtolower($name),0,$offset) == $this->schema . '.') {
$name = substr($name,$offset);
}
} However, in Table->setupReferrers(), there is this line: $foreignTable = $this->getDatabase()->getTable($foreignKey->getForeignTableName()); I am using multiple schemas to reference a foreign key to the other schema (and what's worse, in SQL only, not a real foreign key). XML looks like: <foreign-key name="beta_projects" foreignTable="projects" foreignSchema="beta" skipSql = "true" phpName="BetaProjects">
<reference local="project_id" foreign="id"/>
</foreign-key> Any suggestions on how to handle a foreign key reference to a different schema? |
Well, with your example, that wouldn't work with 'hasTable(), but that would work with 'getTable()', right? |
The issue is the foreign key references a table/field in another schema, and hence another Database (I believe). Therefore, when checking the database analysisdbv2, the above foreign key references the beta schema, which would be beta.projects.id. When you are in the analysisdbv2 database structure, inspecting foreign keys, how can/should we validate a reference to an external schema? |
Hi all, i have the same problem: SET FOREIGN_KEY_CHECKS = 0; And so on, is there any workaround for this issue (Using other tools e.g)?? I have symfony 2.6.11 and propel-bundle 1.4.5 |
The new 1.6 migrations cannot support multiple schemas. If you have 2 schemas:
schema1:
schema2:
The diff task generates:
Imported from: http://www.propelorm.org/ticket/1483
The text was updated successfully, but these errors were encountered: