frizzle
frizzle

Reputation: 93

Connect Symfony project to docker database

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!

Upvotes: 2

Views: 396

Answers (1)

DevDonkey
DevDonkey

Reputation: 4880

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.

Upvotes: 2

Related Questions