DB_PREFIX is not recognized in migration dropColumn and dropForeign #33081
-
Description:DB_PREFIX is not recognized in migration dropColumn and dropForeign. As prefix creates foreign keys with prefix itself, while removing, it fails to associate the same and halts. To by pass, each case table name must be wrapped with env('DB_PREFIX') Steps To Reproduce:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
@armancodes 'prefix' => env('DB_PREFIX', ''), which works, all normal create, drop works except for foreign keys added/dropped in a migration. This issue is related to dropColumn and dropForeign. If you use dropColumn with array wrap like dropColumn (['column_name']) it drops column as well foreign keys associated unless you use DB_PREFIX |
Beta Was this translation helpful? Give feedback.
-
Can you share the code and the error? |
Beta Was this translation helpful? Give feedback.
-
Moving to discussions. |
Beta Was this translation helpful? Give feedback.
Can you share the code and the error?