Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-1037

Migration does not quote identifiers when checking migration version


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Migrations
    • Labels:
    • Environment:
      Linux version 2.4.21-63.ELsmp (mockbuild@x86-005.build.bos.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)) #1 SMP Wed Oct 28 23:15:46 EDT 2009, Symfony 1.4.14-DEV, Oracle 11g


      I happen to be using Symfony 1.4.14-DEV (r33007) and am trying to setup migrations with Oracle, which is using Doctrine_Core::ATTR_QUOTE_IDENTIFIER. This issue is in core Doctrine.

      To reproduce:

      1. Make a change to your schema.yml
      2. Create the migrations diff by executing php symfony doctrine:generate-migrations-diff
      3. New file have been created at ./lib/migration/doctrine/*_version1.php
      4. Try to migrate using command php symfony doctrine:migrate
      5. Results in error:

      ORA-00942: table or view does not exist : SELECT version FROM migration_version. Failing Query: "SELECT version FROM migration_version"

      Cause: The current connection is using quoted identifiers, so the query used to create the migration_version table when migrations are first instantiated was properly created as "migration_version" (notice quotes). But the raw SQL query used in Doctrine_Migration::getCurrentVersion() is not quoting the table or column identifiers, so Oracle can't find the table.

      There are several places in Doctrine_Migration where the table and column identifiers are not quoted, thus breaking migrations when using a database with strict rules on the case of identifiers.

      Even though I'm developing against Oracle, this also likely affects other drivers.



          • Assignee:
            jwage Jonathan H. Wage
            johnkary John Kary
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: