B
B
bondle2020-05-20 15:41:55
PHP
bondle, 2020-05-20 15:41:55

Can Doctrine be used on an existing database?

There is a legacy code. I would not want to remake the database, but I want to get rid of sql queries and automatically collect objects. I know how you can build new applications with Doctrine, but I'm not sure if you can also use all this for an existing one.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex P., 2020-05-20
@Big_Alex

If I didn’t mess up anything and understood you correctly, then you can ..
The algorithm of actions will be something like this:
- create entities for tables from the database
- establish and register their relationships with each other
- Check
- Repeat)
UPD:
I thought about it ..
If it doesn’t matter it will be necessary to find and establish links between themselves, then as an option, you can "generate a database from the Doctrine" and fill in the data from the old database.

B
bondle, 2020-05-20
@bondle

Found. https://symfony.com/doc/current/doctrine/reverse_e...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question