mysql - Laravel migration works in strange way -
i've dropped test database want create new database using saved migrations:
2017_03_01_000000_create_api_table.php 2017_03_06_000000_create_beeline_calls.php 2017_03_13_000000_modify_beeline_emails.php 2017_03_14_000000_interactive_forms.php 2017_03_16_000000_model_instances.php 2017_03_24_000000_create_objects.php 2017_03_24_000001_create_objects_tables_v2.php 2017_03_24_000003_make_comments_without_users.php 2017_03_27_000000_add_processed_to_announcements.php 2017_03_29_000000_create_ads_channels.php 2017_03_29_000001_announcement_client.php 2017_04_06_000000_create_filters.php 2017_04_07_000000_create_new_input_types.php
when run php artisan migrate --pretend
[doctrine\dbal\schema\schemaexception] there no column name 'creator_id' on table 'application_model_instance_announcement_comments'.
but first migration file run 2017_03_01_000000_create_api_table.php
why run not start? database empty, migrations
table empty. understand laravel should run migration files in alphabetical order.
to able perform php artisan migrate
table creating columns can't contain same column names in migration. must delete first , command
php artisan migrate:refresh
you doing this
php artisan migrate:rollback php artisan migrate
there 2 commands in php artisan migrate:refresh
when changing in migrations run these commands:
php artisan cache:clear php artisan view:clear php artisan route:clear composer dump-autoload
it clear old stuff , should run smoothly!
Comments
Post a Comment