Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1232

getAlterTableSQL is not supported by platform SQLite

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.6
    • Fix Version/s: None
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None
    • Environment:
      macosx, sqlite

      Description

      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.

        Activity

        Christian Schaefer created issue -
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - Which is correct, because ALTER TABLE is not supported by SQLite.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Hide
        Christian Schaefer added a comment -

        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.

        Show
        Christian Schaefer added a comment - 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.
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - In Sqlite you need to drop-database + create-database to get it working.
        Hide
        Dan Osipov added a comment -

        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?

        Show
        Dan Osipov added a comment - 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?
        Hide
        Yitzchak Schaffer added a comment -

        +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

        Show
        Yitzchak Schaffer added a comment - +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
        Benjamin Eberlei made changes -
        Workflow jira [ 12754 ] jira-feedback [ 14921 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14921 ] jira-feedback2 [ 16785 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16785 ] jira-feedback3 [ 19038 ]
        Hide
        Martin Hasoň added a comment -
        Show
        Martin Hasoň added a comment - Proposed solution http://www.doctrine-project.org/jira/browse/DBAL-370
        Hide
        Benjamin Eberlei added a comment -

        A related Github Pull-Request [GH-242] was opened
        https://github.com/doctrine/dbal/pull/242

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-242] was opened https://github.com/doctrine/dbal/pull/242
        Marco Pivetta made changes -
        Assignee Benjamin Eberlei [ beberlei ] Marco Pivetta [ ocramius ]
        Hide
        Benjamin Eberlei added a comment -

        A related Github Pull-Request [GH-242] was closed
        https://github.com/doctrine/dbal/pull/242

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-242] was closed https://github.com/doctrine/dbal/pull/242
        Hide
        Galou added a comment -

        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

        Show
        Galou added a comment - 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

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1232, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Christian Schaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: