#60 ✓resolved
Franklin Amorim

Bug no parse de comandos sql com parenteses

Reported by Franklin Amorim | October 21st, 2009 @ 12:04 PM | in v1.5.1


Ao executar o db-migrate com SQL's com erro no número de parenteses o programa ignora todos os comandos seguintes da mesma migration, não reporta erro, e passa para a próxima migration.


Alterar o primeiro sql da migration example/20090123195634_create_table_users.migration, acrescentando um parentese:

@@@SQL_UP = u""" CREATE TABLE users (
id int(11) NOT NULL auto_increment, oid varchar(500) default NULL, first_name varchar(255) default NULL, last_name varchar(255) default NULL, email varchar(255) default NULL, PRIMARY KEY (id) )); -- [coloquei um parentese a mais] """

SQL_DOWN = u"""

Saida da execução:

@@@C:\Git\example>db-migrate -c simple-db-migrate.conf --drop-database

Starting DB migration... - Current version is: 0 - Destination version is: 20090228235709

Starting migration up! *** versions: ['20090123195634', '20090211120001', '20090211120002', '20090211120003', '20090228235709']

===== executing 20090123195634_create_table_users.migration (up) ===== ===== executing 20090211120001_add_user_age.migration (up) ===== [ERROR] error executing migration: (1146, "Table 'migration_example.users' doesn 't exist")

[ERROR DETAILS] SQL command was: ALTER TABLE users add column age int(11) NULL

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

simple-db-migrate is a database migration tool inpired on Rails migrations. For more info check the project website: http://guilhermechapiewski.github.com/simple-db-migrate/