Issue
I am trying to update the data type of my column due to it requiring encryption. I created a new migration to do so and have tried this:
public function up()
{
Schema::table('users', function(Blueprint $table) {
$table->dropColumn(['team', 'service_number']);
$table->string('team', 188);
$table->string('service_number', 188);
});
}
However, I get this error:
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'team' (SQL: alter table `users` add `team` varchar(1024) not null, add `service_number` varchar(1024) not null)
How can I update the data type of my columns in my table?
Solution
I think you need to do this (though that won't drop the columns):
$table->string('team', 188)->change();
$table->string('service_number', 188)->change();
Answered By - Rok Sprogar Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.