2

I'm currently working on a project, that works with bag-files. Therefore I'm using a tool called bag-database(https://github.com/swri-robotics/bag-database), where the database is running as two docker containers. I followed the instructions on the site really closely and got it up and running on port 8080. The other container is running on port 5432.

So now I'm kind of having trouble to connect the Symfony project with the database. I used port 5432 in the config file and then ran php app/console doctrine:database:create and it created a new postgres database, but it was empty.

So my question is: How can I get all the tables and columns from the bag database to be able to map them properly in the project? Or is it not possible to use the tool in that way?

Any help is really appreciated!

1 Answer 1

2

when you ran doctrine:database:create it only created the database as thats what its supposed to do.

What you need is a schema.

As you have an existing database, you will need to reverse engineer the schema from your existing database tables etc.

Fortunately, Symfony already thought of that, and has a set of commands that you can use to do that.

Make sure you check the resulting classes carefully though, I've not used it in a while, but when I have it is possible for it to make mistakes.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply! I tried php app/console doctrine:mapping:import - - force AppBundle annotation but it returned "Database does not have any mapping information". I checked my parameters file afterwards and port and database name look fine. Do you have an idea what to do?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.