mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-23 19:59:18 -08:00
Check if db_column foield already exists
This commit is contained in:
parent
24b356dba4
commit
f254958db9
|
@ -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) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue