-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Package have internal migration included.
It is hard registered inside the Serivce Provider and have own timestamp: 2018_08_11_003343_create_log_table
This leads to behavior that breaks normal flow of artisan migrate command in case the log table migration already exists with modified structure or should be created by migration leaded after that.
For example of modification: if the table needs to be separated to some kind of partitions, but it required to be exists before some previous migrations by the current migration's timestamp.
Current behavior force to do the manual per-file migration to avoid this problem.
I see several ways to fix this behavior:
-
Simplest solution: wrap migration by
if (Schema::hasTable(...) { ... }. That is easiest but not the better way, 'cause it hides the migration from a dev and imposes some restrictions. -
Better solution:
-
2.1. Remove the registration of the migration from the Service Provider
-
2.2. Add another one directive like directive with config to publishes a copy of the migration to common migrations directory on the normal laravel structire to allow modify it by dev's needs.
-
2.3. Rename migration to give it inert timestamp
0000_00_00_000000_create_log_tablelike it doing some of built-in migration of the framework. This kind of name of migrations should make it started 1st and when you publish it, it will appear at the beginning of the migrations list, that allow devs to catch sight of the migration and rename it giving timestamp they need or leave it as is.