Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration silently does not run sql statement properly #1096

Closed
filiperochalopes opened this issue Jan 3, 2023 · 2 comments
Closed

Migration silently does not run sql statement properly #1096

filiperochalopes opened this issue Jan 3, 2023 · 2 comments

Comments

@filiperochalopes
Copy link

OS: MacOS Ventura.
Project (docker ready): https://github.com/filiperochalopes/cadastro-procedimentos-fisioterapia/tree/develop.

image.

To reproduce:

# Run containers with docker-compose, unfortunatelly I can't share the initial database sql because it has sensitive data
make run
propel migrate

The SQL statement is not working but if I run it in a SQL terminal it runs normaly.

   public function preUp(MigrationManager $manager)
    {

        $pdo = $manager->getAdapterConnection('default');

        $tabela_records = TabelaQuery::create()->find();

        echo "Removendo patentes de fisioterapeutas (tabela)...\n";
        // Removendo patentes e títulos do nome do fisioterapeuta na lista de tabelas
        $sql = "UPDATE tabela SET fisioterapeuta=TRIM(REGEXP_REPLACE(fisioterapeuta, 'GM\\s(\\(S\\)\\s)?|Ten\\.\\s|\\s\\(Estagiári.\\)|CC\\s(\\(S\\)\\s)?|SO\\s|Dr.?\\.\\s', '')) WHERE fisioterapeuta  IS NOT NULL;";
        $stmt = $pdo->prepare($sql);
        $stmt->execute();

And the worse part it fails silently and you won't see any warning or error

@filiperochalopes
Copy link
Author

Running on dbeaver returns ok.
image

@filiperochalopes
Copy link
Author

Oppening issue on Propel2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant