I wrote an application in Yii2, and unfortunately, we've lost all the database back ups. What we now have is the application files only. Is there a shorter way of recreating the 98 database tables based on the existing models? I notice that some 22 Tables' Schema were cached under "/app/runtime/cache". Has anyone done something like this?
I have to warn that I have used this ones and it's very helpful, when you need some a$$ saving.
This is a very interesting extension for Gii, that will at least help you restart the database, and then you will be working on it to fix some things.
What it will allow you to do, it's to build migrations from the PHPDoc in your models. The use those migrations to rebuild the database.
You need to install https://github.com/Insolita/yii2-migrik by using composer, if it gives you some trouble use version 2.3 and not 3.
Add
"insolita/yii2-migration-generator": "2.3"
Then open Gii and use "Model and PhpDoc migrations".
Now use Yii2 migration system to build the tables, check the migrations, compare them to the models and add relations, them UP them and will need to fix some stuff. It's not perfect. But it saves time.
https://www.yiiframework.com/doc/guide/2.0/en/db-migrations
Good luck.