Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Bug no parse de comandos sql com parenteses

#60

Problema:

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.

Reprodução:

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"""
DROP TABLE users;
"""


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

Reported by Franklin Amorim · October 21st, 2009 @ 12:04 PM

State: resolved
Milestone: v1.5.1
Assigned to: Guilherme Chapiewski Guilherme Chapiewski

Activity

  1. Wandenberg Peixoto
    Wandenberg Peixoto
    • State changed from new to resolved
    • Milestone changed from BACKLOG to v1.5.1
    • Milestone order changed from 0 to 0

    Done

    April 19th, 2012 @ 12:28 AM

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.