38 lines
918 B
PHP
38 lines
918 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateArticlesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
if (! Schema::hasTable('articles')) {
|
|
Schema::create('articles', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->string('titleurl', 50)->unique();
|
|
$table->string('url', 120)->nullable();
|
|
$table->string('title');
|
|
$table->longText('main');
|
|
$table->tinyInteger('published')->default(0);
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('articles');
|
|
}
|
|
}
|