Can't execute sql script to migrate database ()

Hello,
I have successfully deployed a Symfony (5.4) app on Platform.sh.
However, everytime i try to migrate my database with symfony < sql ./script.sql
I get a [RuntimeException] Aborted.
Please can somebody help with this? :smiling_face_with_tear:

0

Comments

5 comments
Date Votes
  • Hi @wmn

    Nice to know that you try Platform.sh with Symfony 5.4.

    Could you please give us more details:

    • did you create your project from Symfony CLI (new with option --cloud or symfony project:init )?
    • is your database created? do you see a database in the technical figure of your project from the console (bottom left schema) ?
    • what is the result of this command: platform ssh "php bin/console d:s:u --dump-sql" (add --force option if there is a list of SQL commands)
    • did you create a relationship from your app to your database (.platform/services.yaml + relationships: in .platform.app.yaml) ?
    • could you please copy/paste the entire deployment log here?

    let me know

    ps: One thing that could help is comparing your sources with the one from the official Symfony 5.4 template

    0
  • Hello @flovntp
    Thank you for your reply.
    Indeed I have done everything exactly as you ask, but I still can’t execute custom SQL script.
    However I have found a way around by migrating my data through Doctrine Migration (which is automatically executed by Platform.sh deployment - what a great PaaS :slight_smile: ). It solves my issue for now. Thanks again!

    0
  • Hi @wmn

    ok, glad that you manage to solve your issue.
    But i’m curious to understand why you can’t import sql script.

    did you try it like described in the Symfony CLI Tips (last command) ?
    as far as i see in your first comment, you didn’t write well the command : sql is not after the < but before :wink:

    0
  • Hello @flovntp
    You’re right, the < is after sql, but the error is only on my post.
    I confirm that my command was symfony sql < script.sql :wink:

    Just tried with symfony cloud:sql < script.sql like described in the Symfony CLI Tips and I still get the [RuntimeException] Aborted error…

    0
  • and if you add -vvv with your command ?
    symfony sql -vvv < script.sql

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post