mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #16345 from marcusmoore/fixes/update-custom-fields
Fixed renaming custom fields
This commit is contained in:
commit
5e3855ee5b
|
@ -149,11 +149,6 @@ class CustomField extends Model
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is just a dumb thing we have to include because Laraval/Doctrine doesn't
|
|
||||||
// play well with enums or a table that EVER had enums. :(
|
|
||||||
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
|
|
||||||
$platform->registerDoctrineTypeMapping('enum', 'string');
|
|
||||||
|
|
||||||
// Rename the field if the name has changed
|
// Rename the field if the name has changed
|
||||||
Schema::table(self::$table_name, function ($table) use ($custom_field) {
|
Schema::table(self::$table_name, function ($table) use ($custom_field) {
|
||||||
$table->renameColumn($custom_field->convertUnicodeDbSlug($custom_field->getOriginal('name')), $custom_field->convertUnicodeDbSlug());
|
$table->renameColumn($custom_field->convertUnicodeDbSlug($custom_field->getOriginal('name')), $custom_field->convertUnicodeDbSlug());
|
||||||
|
|
Loading…
Reference in a new issue