Reverse the migrations.
@return void
162909
public function down()
    {
        $orderToClear = [
            'tbl_notifications_stack_read',
            'tbl_notifications_stack_params',
            'tbl_notifications_stack',
            'tbl_notification_contents',
            'tbl_notifications',
            'tbl_notification_types',
            'tbl_notification_severity',
        ];

        foreach ($orderToClear as $tablename) {
            if (Schema::hasTable($tablename)) {
                DB::unprepared('DELETE FROM ' . $tablename);
            }
        }

        $orderToDelete = [
            'tbl_notifications_stack_read',
            'tbl_notifications_stack_params',
            'tbl_notifications_stack',
            'tbl_notification_severity',
            'tbl_notification_contents',
            'tbl_notifications',
            'tbl_notification_types',
        ];
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        foreach ($orderToDelete as $tablename) {
            Schema::dropIfExists($tablename);
        }
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }
1196137
public function down()
	{
        if(Schema::hasTable('hlogeon_scms_types')){
            if(Schema::hasColumns('hlogeon_scms_types', ['list_layout_id', 'enable_own_sidebar'])){
                Schema::table('hlogeon_scms_types', function(Blueprint $table){
                    $table->dropColumn('list_layout_id');
                    $table->dropColumn('type_layout_id');
                    $table->dropColumn('enable_own_sidebar');
                    $table->string('type_layout');
                });
            }
        }
    }
1343229
public function down()
    {
        $activity = new Activity();
        $connection = $activity->getConnectionName();
        $table = $activity->getTableName();

        Schema::connection($connection)->dropIfExists($table);
    }
158723
public function down()
    {
        Schema::rename('images', 'imageables');

        Schema::table('imageables', function (Blueprint $table) {
            $table->renameColumn('resource_id', 'imageable_id');
            $table->renameColumn('resource_model', 'imageable_type');
            $table->renameColumn('original_image', 'file');
            $table->dropColumn('retina_factor');
            $table->dropColumn('image_type');
            $table->integer('orientation')->after('original_image');
        });
    }
192753
public function down()
    {
        Schema::table('content', function (Blueprint $table) {
            $table->string('identifier', 50)->nullable()->change();
            $table->dropIndex(['identifier']);
        });
    }
35345
public function down()
    {
        $resources = LaramanagerResource::all();

        $resources->each(function (LaramanagerResource $laramanagerResource) {
            LaramanagerNavigationLink::where('title', $laramanagerResource->title)->delete();
        });
    }
1199578
public function down()
    {
        Schema::table(config('follow.followable_table', 'followables'), function ($table) {
            $table->dropForeign(config('follow.followable_table', 'followables').'_user_id_foreign');
        });

        Schema::drop(config('follow.followable_table', 'followables'));
    }
779644
public function down()
    {
        Schema::table('activity_log', function (Blueprint $table) {
            $table->dropColumn('log_name');
            $table->dropColumn('description');
            $table->dropColumn('subject_id');
            $table->dropColumn('subject_type');
            $table->dropColumn('causer_type');
            $table->dropColumn('causer_id');
            $table->dropColumn('causer_type');
            $table->dropColumn('properties');

            $table->integer('user_id')->nullable();
            $table->string('text');
            $table->string('ip_address', 64);            
        });
    }
601730
public function down()
    {
        Schema::table('notifications', function (Blueprint $table) {
            $table->renameColumn('expires_at', 'expire_time');
        });
        Schema::table('notifications', function (Blueprint $table) {
            $table->bigInteger('from_id')->unsigned()->change();
        });
    }
749385
public function down()
    {
        Schema::table('ticketit', function (Blueprint $table) {
            $table->dropIndex('ticketit_subject_index');
            $table->dropIndex('ticketit_status_id_index');
            $table->dropIndex('ticketit_priority_id_index');
            $table->dropIndex('ticketit_user_id_index');
            $table->dropIndex('ticketit_agent_id_index');
            $table->dropIndex('ticketit_category_id_index');
            $table->dropIndex('ticketit_completed_at_index');
        });

        Schema::table('ticketit_comments', function (Blueprint $table) {
            $table->dropIndex('ticketit_comments_user_id_index');
            $table->dropIndex('ticketit_comments_ticket_id_index');
        });

        Schema::table('ticketit_settings', function (Blueprint $table) {
            $table->dropIndex('ticketit_settings_lang_index');
            $table->dropIndex('ticketit_settings_slug_index');
        });
    }
869596
public function down()
    {
        // Check if the 2 tables exist
        if (Schema::hasTable('tags') && Schema::hasTable('taggables')) {
            if (! Schema::hasColumn('tags', 'tagable_id') && ! Schema::hasColumn('tags', 'tagable_type')) {
                Schema::table('tags', function($table) {
                    $table->integer('tagable_id')->default(1);
                    $table->string('tagable_type', 32)->default('type');
                });
                $tags = DB::table('tags')->get();
                foreach ($tags as $tag) {
                    $tagable = DB::table('taggables')->where('tag_id', '=', $tag->id)->first();
                    if ($tagable) {
                        // Points to old namespace Redooor\\Redminportal\\
                        $old_type_array = explode('\\', $tagable->taggable_type);
                        $last_model = array_pop($old_type_array);
                        $old_type = 'Redooor\\Redminportal\\' . $last_model;
                        DB::table('tags')
                            ->where('id', $tag->id)
                            ->update([
                                'tagable_id' => $tagable->taggable_id,
                                'tagable_type' => $old_type
                            ]);
                    }
                }
            }
        }
    }
217783
public function down()
    {
        // Remove columns from products
        if (Schema::hasTable('products')) {
            Schema::table('products', function(Blueprint $table)
            {
                if (Schema::hasColumn('products', 'weight_unit')) {
                    $table->dropColumn('weight_unit');
                }
                if (Schema::hasColumn('products', 'volume_unit')) {
                    $table->dropColumn('volume_unit');
                }
                if (Schema::hasColumn('products', 'length')) {
                    $table->dropColumn('length');
                }
                if (Schema::hasColumn('products', 'width')) {
                    $table->dropColumn('width');
                }
                if (Schema::hasColumn('products', 'height')) {
                    $table->dropColumn('height');
                }
                if (Schema::hasColumn('products', 'weight')) {
                    $table->dropColumn('weight');
                }
            });
        }
    }
1103751
public function down()
    {
        $twoStepAuth = new TwoStepAuth();
        $connection = $twoStepAuth->getConnectionName();
        $table = $twoStepAuth->getTableName();

        Schema::connection($connection)->dropIfExists($table);
    }
971754
public function down()
    {
        PermissionsManager::deleteRole('admin', 'Administrator');
        PermissionsManager::deleteRole('user', 'User');
        PermissionsManager::deleteRole('banned', 'Banned user');

        PermissionsManager::deletePermission('login', 'Allow login');
        PermissionsManager::deletePermission('panel', 'Allow access to admin panel');
    }
1354581
public function down()
    {
        Schema::table('hc_pages_translations', function (Blueprint $table) {
            $table->timestamp('publish_at')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->timestamp('expires_at')->nullable();
        });
    }
438133
public function down()
    {
        Schema::table('notifications', function ($table) {
            $driver = Config::get('database.driver');

            if ($driver === 'mysql' || $driver === 'sqlite') {
                DB::statement('ALTER TABLE notifications MODIFY COLUMN extra STRING(255)');
            } elseif ($driver === 'pgsql') {
                DB::statement('ALTER TABLE notifications ALTER COLUMN extra TYPE string USING code::json');
            }
        });
    }
596414
public function down()
    {
        Schema::dropIfExists(config('admin.database.users_table'));
        Schema::dropIfExists(config('admin.database.roles_table'));
        Schema::dropIfExists(config('admin.database.permissions_table'));
        Schema::dropIfExists(config('admin.database.menu_table'));
        Schema::dropIfExists(config('admin.database.user_permissions_table'));
        Schema::dropIfExists(config('admin.database.role_users_table'));
        Schema::dropIfExists(config('admin.database.role_permissions_table'));
        Schema::dropIfExists(config('admin.database.role_menu_table'));
        Schema::dropIfExists(config('admin.database.operation_log_table'));
    }