Tree Travel Guide
This commit is contained in:
parent
a1ca534f55
commit
1f340e96fa
78 changed files with 4133 additions and 1027 deletions
|
|
@ -16,11 +16,16 @@ class CreateTravelGuidesTable extends Migration
|
|||
Schema::connection('mysql_stern')->create('travel_guides', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
|
||||
$table->unsignedBigInteger('tree_node_id');
|
||||
|
||||
$table->string('name');
|
||||
$table->string('slug')->index()->unique();
|
||||
|
||||
$table->string('text')->nullable();
|
||||
$table->text('full_text')->nullable();
|
||||
$table->string('keyword')->nullable();
|
||||
|
||||
|
||||
$table->string('meta_title')->nullable();
|
||||
$table->string('meta_description')->nullable();
|
||||
|
|
@ -31,6 +36,11 @@ class CreateTravelGuidesTable extends Migration
|
|||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('tree_node_id')
|
||||
->references('id')
|
||||
->on('i_q_content_tree_nodes');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateIQContentTreesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('mysql_stern')->create('i_q_content_trees', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
|
||||
$table->string('name', 64)->index();
|
||||
$table->string('identifier', 80)->index();
|
||||
$table->string('slug', 80)->index()->unique();
|
||||
$table->string('description')->nullable();
|
||||
|
||||
$table->text('settings')->nullable();
|
||||
$table->unsignedTinyInteger('pos')->default(0);
|
||||
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql_stern')->dropIfExists('i_q_content_trees');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateIQContentTreeNodesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('mysql_stern')->create('i_q_content_tree_nodes', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
//from tree
|
||||
$table->unsignedBigInteger('tree_id');
|
||||
|
||||
//parent node
|
||||
$table->unsignedBigInteger('parent_id')->index()->nullable();
|
||||
$table->unsignedTinyInteger('lvl')->index()->default(0);
|
||||
|
||||
//used site
|
||||
// $table->unsignedBigInteger('site_id');
|
||||
|
||||
$table->string('name', 64)->index();
|
||||
$table->string('identifier', 80)->index();
|
||||
$table->string('slug', 80)->index()->unique();
|
||||
$table->string('description')->nullable();
|
||||
|
||||
$table->text('settings')->nullable();
|
||||
$table->unsignedTinyInteger('pos')->default(0);
|
||||
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
|
||||
$table->foreign('tree_id')
|
||||
->references('id')
|
||||
->on('i_q_content_trees');
|
||||
|
||||
$table->foreign('parent_id')
|
||||
->references('id')
|
||||
->on('i_q_content_tree_nodes');
|
||||
|
||||
/*$table->foreign('site_id')
|
||||
->references('id')
|
||||
->on('i_q_content_sites');
|
||||
*/
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql_stern')->dropIfExists('i_q_content_tree_nodes');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue