Monday, 3 February 2020

Laravel migration drop unique and foreign key constraint

      
UNIQUE

//By default, Laravel automatically assigns a reasonable name to the indexes. Simply concatenate the table name, the name of the indexed column, and the index type.
            $table->dropUnique('<column_name>_unique');


FOREIGN
Laravel uniquely names the foreign key reference like this:
<table_name>_<foreign_table_name>_<column_name>_foreign
https://stackoverflow.com/questions/27175808/dropping-column-with-foreign-key-laravel-error-general-error-1025-error-on-ren

No comments:

Post a comment