6
0
Fork 0
jiqu-library-server/database/migrations/2021_11_18_135133_create_ad...

49 lines
1.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ad_addresses', function (Blueprint $table) {
$table->id();
$table->string('key')->unique()->comment('广告位KEY');
$table->string('name')->nullable()->comment('广告位名称');
$table->string('dimensions')->nullable()->comment('广告位宽高');
$table->tinyInteger('is_show')->default(0)->comment('是否显示0不显示1显示');
$table->timestamps();
});
Schema::create('ads', function (Blueprint $table) {
$table->id();
$table->bigInteger('address_id')->default(0)->comment('广告位ID');
$table->string('image')->nullable()->comment('图片地址');
$table->integer('sort')->default(0)->comment('广告排序:逆序');
$table->tinyInteger('jump_type')->default(0)->comment('跳转类型0不跳转1跳转应用内页2H5链接');
$table->string('jump_link')->nullable()->comment('跳转地址');
$table->tinyInteger('is_show')->default(0)->comment('是否显示0不显示1显示');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ads');
Schema::dropIfExists('ad_addresses');
}
}