【发布时间】:2017-09-02 16:08:14
【问题描述】:
我已经删除了我的测试数据库,然后我想使用保存的迁移创建新数据库:
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
当我运行php artisan migrate --pretend
[Doctrine\DBAL\Schema\SchemaException]
There is no column with name 'creator_id' on table 'application_model_instance_announcement_comments'.
但要运行的第一个迁移文件是2017_03_01_000000_create_api_table.php
为什么它不从头开始运行?数据库为空,migrations 表为空。
据我了解,Laravel 应该按字母顺序运行迁移文件。
【问题讨论】:
-
php artisan migrate:refresh --seed try thin one
-
migrate不起作用,但migrate:refresh起作用了。我不明白为什么...... -
我认为 migrate refresh 在我的分析器中也有一些这些命令,它会删除数据库表中的所有迁移和数据......所以这就是它起作用的原因。