mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -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 = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
|
||||||
$platform->registerDoctrineTypeMapping('enum', 'string');
|
$platform->registerDoctrineTypeMapping('enum', 'string');
|
||||||
|
|
||||||
Schema::table('custom_fields', function ($table) {
|
if (!Schema::hasColumn('custom_fields', 'db_column')) {
|
||||||
$table->string('db_column')->nullable();
|
Schema::table('custom_fields', function ($table) {
|
||||||
$table->text('help_text')->nullable();
|
$table->string('db_column')->nullable();
|
||||||
});
|
$table->text('help_text')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
foreach(CustomField::all() as $field) {
|
foreach(CustomField::all() as $field) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue