first upload all files
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class Create$PLURAL_ENTITY_NAME$Table extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('$PLURAL_SNAKE_CASE_ENTITY_NAME$', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('$PLURAL_SNAKE_CASE_ENTITY_NAME$');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class Create$ENTITY_NAME$TranslationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('$SNAKE_CASE_ENTITY_NAME$_translations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('$SNAKE_CASE_ENTITY_NAME$_id')->unsigned();
|
||||
$table->string('locale');
|
||||
|
||||
$table->unique(['$SNAKE_CASE_ENTITY_NAME$_id', 'locale']);
|
||||
$table->foreign('$SNAKE_CASE_ENTITY_NAME$_id')->references('id')->on('$PLURAL_SNAKE_CASE_ENTITY_NAME$')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('$SNAKE_CASE_ENTITY_NAME$_translations');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user