turkmentv/database/migrations/2019_05_28_112418_create_pa...

38 lines
940 B
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePageadsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pageads', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->enum('adv_type',['image','video']);
$table->longText('poster_url')->nullable();
$table->longText('img_url')->nullable();
$table->longText('video_url')->nullable();
$table->unsignedInteger('page_id')->nullable();
$table->foreign('page_id')->references('id')->on('pages');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pageads');
}
}