FIX: lots of bugfixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Widgets\Widget;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
@@ -45,12 +46,16 @@ class AddUniqueCodeToWidgets extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->dropUnique('widgets_language_container_id_unique');
|
||||
});
|
||||
try {
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->dropUnique('widgets_language_container_id_unique');
|
||||
});
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
// migrate data
|
||||
$widgets = \App\Models\Widget::all();
|
||||
$widgets = Widget::all();
|
||||
foreach ($widgets as $widget) {
|
||||
$widget->settings = (object)json_decode($widget->settings);
|
||||
$widget->settings->containerClass = $widget->container_class;
|
||||
|
||||
@@ -27,7 +27,6 @@ class RenameColumnInContents extends Migration
|
||||
'url',
|
||||
'meta_keywords',
|
||||
'meta_description',
|
||||
'content',
|
||||
'module_settings',
|
||||
'status'
|
||||
];
|
||||
|
||||
@@ -13,10 +13,10 @@ class DropCustomFieldsTables extends Migration
|
||||
{
|
||||
Schema::dropIfExists('content_has_custom_fields');
|
||||
Schema::dropIfExists('user_has_custom_field');
|
||||
Schema::dropIfExists('custom_field_types');
|
||||
Schema::dropIfExists('custom_fields');
|
||||
Schema::dropIfExists('custom_field_resource');
|
||||
Schema::dropIfExists('custom_fields');
|
||||
Schema::dropIfExists('custom_field_resources');
|
||||
Schema::dropIfExists('custom_field_types');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user