recreate the old table structure
This commit is contained in:
parent
f16dbca012
commit
fb0393561b
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class RecreateOldTables extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if (!Schema::hasTable('posts')) {
|
||||||
|
Schema::create('posts', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->integer('active')->unsigned()->default(2);
|
||||||
|
$table->string('title')->nullable();
|
||||||
|
$table->text('content')->nullable();
|
||||||
|
$table->text('tags')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!Schema::hasTable('pages')) {
|
||||||
|
Schema::create('pages', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->integer('active')->unsigned()->default(2);
|
||||||
|
$table->string('title')->nullable();
|
||||||
|
$table->text('content')->nullable();
|
||||||
|
$table->string('slug')->nullable()->unique();
|
||||||
|
$table->tinyInteger('order')->unsigned()->nullable();
|
||||||
|
$table->bigInteger('parent')->unsigned()->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('posts');
|
||||||
|
Schema::dropIfExists('pages');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue