Skip to content

Instantly share code, notes, and snippets.

@aldhinya
Created April 28, 2023 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldhinya/6ecb3056b759ae1b08b6ddfcbc720d85 to your computer and use it in GitHub Desktop.
Save aldhinya/6ecb3056b759ae1b08b6ddfcbc720d85 to your computer and use it in GitHub Desktop.
<?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()
{
if (! Schema::hasTable('v1_mapping_platform_store')) {
Schema::create('v1_mapping_platform_store', function (Blueprint $table) {
$table->bigIncrements('id');
$table->foreignId('platform_id')->constrained('v0_platforms', 'id');
$table->foreignId('store_id')->constrained('v0_stores', 'id');
$table->string("name");
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('v1_mapping_platform_store');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment