Skip to content

Loading…

DDC-1232: getAlterTableSQL is not supported by platform SQLite #1841

Closed
doctrinebot opened this Issue · 10 comments

2 participants

@doctrinebot

Jira issue originally created by user caefer:

updating leads to the following error

$ php app/console doctrine:schema:update

[Doctrine\DBAL\DBALException]

Operation 'Doctrine\DBAL\Platforms\AbstractPlatform::getAlterTableSQL' is not supported by platform.

@doctrinebot

Comment created by @beberlei:

Which is correct, because ALTER TABLE is not supported by SQLite.

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot

Comment created by caefer:

so a schema update can not be performed?
if so then there should be a more descriptive error message telling the user not to perform this task on sqlite databases.

@doctrinebot

Comment created by @beberlei:

In Sqlite you need to drop-database + create-database to get it working.

@doctrinebot

Comment created by dosipov:

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?

@doctrinebot

Comment created by yitznewton:

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

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-242] was opened
doctrine/dbal#242

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-242] was closed
doctrine/dbal#242

@doctrinebot

Comment created by galou:

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.
http://www.sqlite.org/lang_altertable.html

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.