D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
forge
/
almahero.online
/
database
/
migrations
/
Filename :
2023_07_17_152902_change_meta_tables.php
back
Copy
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('metas', function (Blueprint $table) { $table->dropColumn('url'); $table->string('slug')->nullable()->after('uuid'); $table->string('og_image')->nullable()->after('meta_keyword'); }); Schema::table('blogs', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('blog_category_id'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('pages', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('slug'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('categories', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('slug'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('subcategories', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('slug'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('users', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('provider_id'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('bundles', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('access_period'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); Schema::table('courses', function (Blueprint $table) { $table->string('meta_title')->nullable()->after('access_period'); $table->text('meta_description')->nullable()->after('meta_title'); $table->text('meta_keywords')->nullable()->after('meta_description'); $table->string('og_image')->nullable()->after('meta_keywords'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('metas', function (Blueprint $table) { $table->string('url')->nullable()->after('uuid'); $table->dropColumn('slug'); $table->dropColumn('og_image'); }); Schema::table('blogs', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); Schema::table('pages', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('og_image'); }); Schema::table('categories', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); Schema::table('subcategories', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); Schema::table('users', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); Schema::table('bundles', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); Schema::table('courses', function (Blueprint $table) { $table->dropColumn('meta_title'); $table->dropColumn('meta_description'); $table->dropColumn('meta_keywords'); $table->dropColumn('og_image'); }); } };