Reputation: 322
I tried to change id
field from Integer auto increment to string but after I run migrate, the structure of MYSQL's not change.
This is my code:
Schema::table('table', function ($table) {
$table->dropPrimary();
$table->string('id', 50)->change()->primary();
});
Please help me, thank you so much.
Upvotes: 1
Views: 1201
Reputation: 1136
You should write this. Hopefully this will solve your problem
Schema::table('table', function ($table) {
$table->dropPrimary('id');
$table->string('id', 50)->change()->primary();
});
Also you should check if doctrine/dbal
is installed successfully
Upvotes: 2