[DDC-1232] getAlterTableSQL is not supported by platform SQLite Created: 27/Jun/11 Updated: 01/Feb/13 Resolved: 27/Jun/11 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | 2.0.6 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Christian Schaefer | Assignee: | Marco Pivetta |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Environment: |
macosx, sqlite |
||
| Description |
|
updating leads to the following error $ php app/console doctrine:schema:update [Doctrine\DBAL\DBALException] |
| Comments |
| Comment by Benjamin Eberlei [ 27/Jun/11 ] |
|
Which is correct, because ALTER TABLE is not supported by SQLite. |
| Comment by Christian Schaefer [ 27/Jun/11 ] |
|
so a schema update can not be performed? |
| Comment by Benjamin Eberlei [ 27/Jun/11 ] |
|
In Sqlite you need to drop-database + create-database to get it working. |
| Comment by Dan Osipov [ 19/Aug/11 ] |
|
I get the same error while executing migrations:diff. Now, I use SQLite locally, but MySQL on production. Shouldn't migrations:diff create database agnostic migration, that I wouldn't be able to execute locally, but would work on production? |
| Comment by Yitzchak Schaffer [ 13/Dec/11 ] |
|
+1 for making this abstract enough to handle a standard dev environment: getAlterTableSQL() should create and store an abstraction, and once that's done, either fail on attempted migration of actual SQLite database, or preferably issue warning & require --force or the like to do DROP + CREATE |
| Comment by Martin HasoĊ [ 22/Oct/12 ] |
|
Proposed solution http://www.doctrine-project.org/jira/browse/DBAL-370 |
| Comment by Benjamin Eberlei [ 02/Jan/13 ] |
|
A related Github Pull-Request [GH-242] was opened |
| Comment by Benjamin Eberlei [ 07/Jan/13 ] |
|
A related Github Pull-Request [GH-242] was closed |
| Comment by Galou [ 01/Feb/13 ] |
|
SQLite supports a limited subset of ALTER TABLE. The ALTER TABLE command in SQLite allows the user to rename a table or to add a new column to an existing table. It is not possible to rename a column, remove a column, or add or remove constraints from a table. |