Add company_id column to media tables

This commit is contained in:
Burak Çakırel
2021-05-17 22:32:45 +03:00
parent bdb51a27a4
commit d13e41f6df
7 changed files with 140 additions and 20 deletions

View File

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CoreV2114 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('media', function (Blueprint $table) {
$table->unsignedInteger('company_id')->after('id');
$table->index('company_id');
});
Schema::table('mediables', function (Blueprint $table) {
$table->unsignedInteger('company_id')->after('media_id');
$table->index('company_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('company_id');
});
Schema::table('mediables', function (Blueprint $table) {
$table->dropColumn('company_id');
});
}
}