Skip to content

Instantly share code, notes, and snippets.

@robsenshuu
Created June 7, 2017 18:04
Show Gist options
  • Save robsenshuu/c4459e8d4bb50d62f9f36d743c97d0e1 to your computer and use it in GitHub Desktop.
Save robsenshuu/c4459e8d4bb50d62f9f36d743c97d0e1 to your computer and use it in GitHub Desktop.
How to create a new migrate in laravel
# ADD NEW COLUMN id_policy INTO TABLE
# action es - alter, update, create, add, drop, etc
# php artisan make:migration MIGRATION_NAME
# --table=TABLENAME in case alter an existing table
php artisan make:migration add_id_policy_documents --table=documents
# after we have to modify our new migrate and add in the UP function
$table->integer('id_policy')->nullable();
# Also in DOWN function add
$table->dropColumn('id_policy');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment