-
Notifications
You must be signed in to change notification settings - Fork 3
Module Migration Generator
The module migration helps you to create database migration for a specific module. it can be acheive quickly using the Migration Generator Command on Artisan Console. Here is the basic schema of the artisan command.
module:migration {module namespace} {--delete=}
is a required feature which let you define on which module this migration will be created. The namespace should be written as it's defined on the module config.xml file.
If provided, this option let you delete migrations folders. The option can be "all" or a specific version number "1.0". If "all" is provided as options all migrations folders will be deleted, otherwise only the specific version number folder will be deleted.
This command let you build the schema directly while providing the migration name. Here is the structure to create a schema (right after having runned the first command).
{migration file name} --table={table name} --schema={schema structure}
it can be anything with spaces. Keeping it simple is adviced.
Let you define the migration table name, with no spaces or any special characters
Let you defined the schema structure. It's structured as following :
--schema={column name}:{column type}|{second column name}:{column type}
The column type are defined as on Laravel Schema Column methods name. If the field type is not provided, the default field type "string" is used by default. Here is an example :
php artisan module:migration Foo
> Create Foo Table --table=foo --schema=title:string|message:text