Some great shortcuts for script generation. I always try to start by building scaffold for any new entity, then remove the scaffold as needed, leaving only the pieces of the scaffold which I need.
to generate a new model:
* This will generate models, controllers, migrations & tests. ALWAYS USE THE SINGULAR when using script/generate.
* Be sure to spell the complete word integer, if you mistakenly shorten it to abbreviated form “int” the generate command will look like it has worked, but migration won’t execute.
If you make a mistake try
to add a field to an existing model
to add a foreign key to an existing model