what can I do if I have failed in laravel deployment as the following:
Deployment hook failed.
Hook: migrate --force
Column already exists: 1060 Duplicate column name 'bio'
Logs: You may review its logs using the hook:log 1178007
command.
enter image description here I don't have access to vapor, can I do something about this error??
CodePudding user response:
it's a problem of recreating new column that was already added before.
You can make sure to validate on this column before creating it like the following:
public function up()
{
Schema::table('table-name', function (Blueprint $table) {
if (! Schema::hasColumn('table-name', 'col-name')) {
$table->text('col-name')->nullable();
}
}
}