Check if db_column foield already exists

This commit is contained in:
snipe 2018-01-17 06:48:14 -08:00
parent 24b356dba4
commit f254958db9

View file

@ -52,10 +52,12 @@ class FixUtf8CustomFieldColumnNames extends Migration
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('custom_fields', function ($table) {
$table->string('db_column')->nullable();
$table->text('help_text')->nullable();
});
if (!Schema::hasColumn('custom_fields', 'db_column')) {
Schema::table('custom_fields', function ($table) {
$table->string('db_column')->nullable();
$table->text('help_text')->nullable();
});
}
foreach(CustomField::all() as $field) {