<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ads', function (Blueprint $table) {
            $table->increments('id');
            $table->string('theme')->default('default')->comment('主题');
            $table->string('alias')->comment('调用名');
            $table->tinyInteger('is_display')->default('1')->comment('是否显示 (1:显示 0:不显示)');
            $table->integer('category_id')->comment('广告分类');
            $table->integer('type_id')->comment('广告属性');
            $table->string('title')->comment('广告标题');
            $table->string('note')->comment('备注');
            $table->integer('list_order')->comment('显示顺序');
            $table->integer('started_at')->comment('开始日期');
            $table->integer('ended_at')->comment('结束日期');
            $table->text('content')->comment('文字广告内容或者其它类型的图片信息等');
            $table->string('url')->comment('广告链接');
            $table->string('text_color')->comment('文字颜色');
            $table->string('explain')->comment('图片文字说明')->nullable();
            $table->integer('uid')->comment('会员UID');
            $table->integer('subsite_id')->default('0')->comment('分站信息(0:总站)');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ads');
    }
}