Closed andrezap closed 7 years ago
It is possible. You can put pretty much any PHP code into migration. But if you want to store migrations log in DB you need to setup DB and connection to it first.
sorry, I dont know if i was clear enough. but my case is: I have a DB, my structure already created, now I'll use phpmig and i dont know if there is a command that inspect my database and create an initial migration file with the current table structures as a starting point.
There is no such command, as far as I know. But you can just use a SQL dump for this.
Yes, my preference would be to dump the existing DB to SQL and have the first migration load that sql dump.
If you require something more portable, you'll need another library from somewhere to reverse engineer the schema in to something else.
ok guys, thank you, im gonna try it
I already have a db created and I would like to use phpmig now, but I need to generate the migrations with my current table structures. Is this possible?