[DBAL-352] Running doctrine:schema:update throws an exception the first time, succeeds the second time. Created: 25/Sep/12 Updated: 25/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Mark A. Hershberger | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Shell output from my symfony project: [Doctrine\DBAL\DBALException] SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'account' doesn't exist in table [PDOException] doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]] $ app/console doctrine:schema:update --force |
| Comments |
| Comment by Christophe Coevoet [ 25/Sep/12 ] |
|
Please run the command with the --dump-sql option instead of --force each time before launching it for real, to be able to see which SQL queries are executed in both cases |
| Comment by Mark A. Hershberger [ 25/Sep/12 ] |
|
I'm not sure how to roll back the changes so that I can reproduce this. |
| Comment by Mark A. Hershberger [ 25/Sep/12 ] |
|
Got it after a little poking around with git. Rolling back to a commit in my code before the one given here didn't didn't show this reproduce this. $ php app/console doctrine:schema:create Creating database schema... $ git checkout d686a39fb664dca540167e1b3e96ea0ffd67bc00 $ php app/console doctrine:schema:update --dump-sql [Doctrine\DBAL\DBALException] SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'account' doesn't exist in table [PDOException] doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]] $ php app/console doctrine:schema:update --dump-sql $ php app/console doctrine:schema:update --force $ |
| Comment by Christophe Coevoet [ 25/Sep/12 ] |
|
hmm, the first update seems to miss the addition of the account field, which is done the second time through ALTER TABLE Tn ADD account INT DEFAULT NULL; |