-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added support for alter table, foreign keys and autoincrement detection to Sqlite platform and schema #220
Conversation
Hello, thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link: |
} | ||
} | ||
|
||
return $list; |
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.
Wrong indentation (using tabs ?)
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.
Fixed
would be great if you could also add support for deferred/deferrable as per lsmith77@bb54ca0#commitcomment-2158125 furthermore that patch also tries to make the support for foreign keys dynamic to handle the case of old sqlite versions and sqlite versions where FKs are disabled. not sure if that is necessary |
there are also some tests you might then also want to add to this PR once you add support for deferred/deferrable #228 |
The pull request is not mergable anymore, can you rebase onto master? |
@@ -498,6 +520,60 @@ protected function getReservedKeywordsClass() | |||
/** | |||
* {@inheritDoc} | |||
*/ | |||
protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) | |||
{ | |||
if (!$diff->fromTable instanceof Table) { |
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.
missing spaces
…dd columns) in Sqlite platform
…itePlatform::getCreateTableSQL method
$query[] = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')'; | ||
|
||
if (isset($options['alter']) && true === $options['alter']) { | ||
return $query; |
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.
Is it correct? It seems if you return here you're not considering the indexes created for this table anymore.
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.
Yes. The indexes are created in getPostAlterTableIndexForeignKeySQL
method. We want to create indexes on renamed table (not on __temp__<name>
).
…r renamed parent tables in SqlitePlatform
{ | ||
if ( ! $table instanceof Table) { | ||
$tableDetails = $this->tryMethod('listTableDetails', $table); | ||
if (false === $table) { |
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.
Typo false === $tableDetails
[WIP] Added support for alter table, foreign keys and autoincrement detection to Sqlite platform and schema
@hason is it just me or will the current implementation simply fail on anything that implies creation of a foreign key? This PR currently breaks all my functional test suites that generate a schema (ORM-side) in memory SQLite because of |
{ | ||
return false; |
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.
This should be reverted. After all, this PR doesn't really add support for it right now
New doctrine 2.3.3 version is available, and I waited a lot for that because i hoped that when create SQLite schema that FK-s will be created also! But not! FK-s are still not generated! Can anyone tell me why?! I know that it was implemented last year (2012) in some branch... What happened?! Its removed or what?! Its not supported in new 2.3.3 doctrine?!?! Zoran |
The $oldColumnName property and the corresponding constructor parameter were relevant until doctrine#220 (2.4.0) which introduced the $fromColumn property and the corresponding constructor parameter. Now they are redundant. The same applies to getOldColumnName(). The $fromColumn property contains all the properties of the old column including the name.
The $oldColumnName property and the corresponding constructor parameter were relevant until doctrine#220 (2.4.0) which introduced the $fromColumn property and the corresponding constructor parameter. Now they are redundant. The same applies to getOldColumnName(). The $fromColumn property contains all the properties of the old column including the name.
The $oldColumnName property and the corresponding constructor parameter were relevant until doctrine#220 (2.4.0) which introduced the $fromColumn property and the corresponding constructor parameter. Now they are redundant. The same applies to getOldColumnName(). The $fromColumn property contains all the properties of the old column including the name.
No description provided.