<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 11:09:16 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-54/DBAL-54.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-54] Incorrect sequence dropping in PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-54</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Currently, DBAL drops the PostgreSQL sequences using the query:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;DROP SEQUENCE sequencename&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;While it is quite correct at the first look, it fails, if the sequence is actually used by a table. Because Doctrine 2 ORM tries to drop the sequences before the tables, it makes impossible to drop a database schema in PostgreSQL due to the following exception:&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;$ php53 doctrine.php orm:schema-tool:drop&lt;br/&gt;
Dropping database schema...&lt;br/&gt;
PDOException&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;2BP01&amp;#93;&lt;/span&gt;: Dependent objects still exist: 7 ERROR:  cannot drop sequence admins_id_seq because other objects depend on it&lt;br/&gt;
DETAIL:  default for table admins column id depends on sequence admins_id_seq&lt;br/&gt;
HINT:  Use DROP ... CASCADE to drop the dependent objects too.&lt;br/&gt;
/.../Libs/Doctrine/DBAL/Connection.php&lt;br/&gt;
Line 570&lt;br/&gt;
Trace:&lt;br/&gt;
        0. PDO::query on line 570&lt;br/&gt;
        1. Doctrine\DBAL\Connection::executeQuery on line 484&lt;br/&gt;
        2. Doctrine\ORM\Tools\SchemaTool::dropSchema on line 78&lt;br/&gt;
        3. Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand::executeSchemaCommand on line 59&lt;br/&gt;
        4. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand::execute on line 159&lt;br/&gt;
        5. Symfony\Component\Console\Command\Command::run on line 205&lt;br/&gt;
        6. Symfony\Component\Console\Application::doRun on line 117&lt;br/&gt;
        7. Symfony\Component\Console\Application::run on line 7&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;A solution is simply to add the &quot;CASCADE&quot; keyword at the end of the query.&lt;/p&gt;

&lt;p&gt;Although I encountered this problem on DBAL 2.0-beta4, I checked the most up-to-date code on Git, and the problem is still present there.&lt;/p&gt;</description>
                <environment>postgresql 8.4.3, Arch Linux 64-bit</environment>
            <key id="11936">DBAL-54</key>
            <summary>Incorrect sequence dropping in PostgreSQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="zyxist">Tomasz J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Sep 2010 05:39:54 +0000</created>
                <updated>Tue, 9 Oct 2012 14:55:47 +0000</updated>
                    <resolved>Thu, 23 Sep 2010 15:05:34 +0000</resolved>
                            <version>2.2.2</version>
                                <fixVersion>2.0.0-RC1-RC3</fixVersion>
                                <component>Platforms</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14427" author="beberlei" created="Tue, 21 Sep 2010 06:57:15 +0000"  >&lt;p&gt;Would it help to drop sequences after tables? If then i would just move the code blocks.&lt;/p&gt;</comment>
                    <comment id="14431" author="zyxist" created="Tue, 21 Sep 2010 10:49:48 +0000"  >&lt;p&gt;In this particular case - yes, it would help. But consider that different database engines may have different dependencies between schema elements and be more or less restrictive, so they may require different order of code blocks. I&apos;d recommend to make a bit deeper investigation here in order not to cause potential problems with other database engines.&lt;/p&gt;</comment>
                    <comment id="14449" author="beberlei" created="Thu, 23 Sep 2010 15:05:34 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="18101" author="jonrwads" created="Wed, 20 Jun 2012 08:13:44 +0000"  >&lt;p&gt;This issue is happening again with Doctrine 2.2.2 on Postgres 9.1.3.  when trying to drio a database I get this message even with --full-database&lt;/p&gt;

&lt;p&gt;&amp;gt; php doctrine.php orm:schema-tool:drop --force --full-database&lt;br/&gt;
Dropping database schema...&lt;/p&gt;



&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;                                                                                                                           &lt;br/&gt;
  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;2BP01&amp;#93;&lt;/span&gt;: Dependent objects still exist: 7 ERROR:  cannot drop sequence policycategory_id_seq because other objects depend on it  &lt;br/&gt;
  DETAIL:  default for table policycategory column id depends on sequence policycategory_id_seq                                            &lt;br/&gt;
  HINT:  Use DROP ... CASCADE to drop the dependent objects too.&lt;/p&gt;

&lt;p&gt;I would love to help diagnose, just let me know what you need and I will be more than happy to help.&lt;/p&gt;</comment>
                    <comment id="18814" author="jonrwads" created="Tue, 9 Oct 2012 14:55:47 +0000"  >&lt;p&gt;I forgot to update this for anyone else who might have had my problem.  The issue was solved for me when I was reviewing some models. The project was originally intended for MySQL and Generated Value Strategy was not set to Auto.  Upon changing it to auto, everything worked correctly.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>