- added nearly all migration files

- added nearly all database seed files
This commit is contained in:
Arno Kaimbacher 2019-08-29 16:58:35 +02:00
parent 489546ef6e
commit 7641c1dfdf
40 changed files with 1168 additions and 915 deletions

View file

@ -0,0 +1,54 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pages', function (Blueprint $table) {
$table->increments('id');
//$table->string('title', 191);
$table->string('page_slug', 191)->unique();
//$table->text('description')->nullable();
$table->string('cannonical_link', 191)->nullable();
$table->string('seo_title', 191)->nullable();
$table->string('seo_keyword', 191)->nullable();
$table->text('seo_description')->nullable();
$table->boolean('status')->default(true);
$table->integer('created_by');
$table->integer('updated_by')->nullable();
$table->dateTime('created_at')->unsigned();
$table->dateTime('updated_at')->unsigned()->nullable();
});
Schema::create('page_translations', function (Blueprint $table) {
$table->increments('id');
$table->integer('page_id')->unsigned();
$table->unique(['page_id','locale']);
$table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade');
$table->string('locale')->index();
$table->string('title');
$table->text('description');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('page_translations');
Schema::dropIfExists('pages');
}
}