laravel-learn-bbs/database/migrations/2018_06_02_204347_create_links_table.php

34 lines
733 B
PHP
Raw Normal View History

2018-06-02 13:48:16 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLinksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('links', function (Blueprint $table) {
$table->increments('id');
$table->string('title')->comment('资源的描述')->index();
$table->string('link')->comment('资源的链接')->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('links');
}
}