clrghouz/database/migrations/2023_07_28_071914_echoarea_security.php

47 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2023-07-29 03:17:36 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
DB::statement('ALTER TABLE echoareas RENAME COLUMN public TO show');
DB::statement('ALTER TABLE fileareas RENAME COLUMN public TO show');
Schema::table('echoareas',function (Blueprint $table) {
$table->smallInteger('security')->unsigned()->nullable();
});
Schema::table('fileareas',function (Blueprint $table) {
$table->smallInteger('security')->unsigned()->nullable();
});
Schema::table('addresses',function (Blueprint $table) {
$table->smallInteger('security')->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
DB::statement('ALTER TABLE echoareas RENAME COLUMN show TO public');
DB::statement('ALTER TABLE fileareas RENAME COLUMN show TO public');
Schema::table('echoareas',function (Blueprint $table) {
$table->dropColumn(['security']);
});
Schema::table('fileareas',function (Blueprint $table) {
$table->dropColumn(['security']);
});
Schema::table('addresses',function (Blueprint $table) {
$table->dropColumn(['security']);
});
}
};