CodeIgniter Forums
Generate model based on migration or tabel scema - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Generate model based on migration or tabel scema (/showthread.php?tid=79849)



Generate model based on migration or tabel scema - titounnes - 08-04-2021

Hi, CI4 developer team.
I have a suggestion, what if generate model is based on migration or schema database? so that the "allow-field" and "primary key" can be automatically filled when the model is created with the php spark make:model command.

I really hope it can happen. Thank you.


RE: Generate model based on migration or tabel scema - MGatner - 08-06-2021

If you’d like to try implementing this we’d be glad to receive a PR! Incidentally, I have a package for various database translations (Tatter\Schemas) and generating models from a database or schema user on the “to do” list - can’t say when it will happen though, busy times. :/