<?php

namespace Database\Migrations;

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

class CreateEbooksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ebooks', function (Blueprint $table) {
            $table->integer('id')->nullable();
            $table->integer('user_id')->nullable();
            $table->string('title', 255)->nullable();
            $table->string('slug', 255)->nullable();
            $table->integer('category_id')->nullable();
            $table->longText('description')->nullable();
            $table->string('publication_name', 255)->nullable();
            $table->string('edition', 255)->nullable();
            $table->integer('is_paid')->nullable();
            $table->double('price')->nullable();
            $table->integer('discount_flag')->nullable();
            $table->double('discounted_price')->nullable();
            $table->string('thumbnail', 255)->nullable();
            $table->integer('published_date')->nullable();
            $table->integer('language_id')->nullable();
            $table->mediumText('summary')->nullable();
            $table->string('preview', 255)->nullable();
            $table->string('complete', 255)->nullable();
            $table->integer('status')->nullable();
            $table->string('average_rating', 255)->nullable();
            $table->timestamp('created_at')->nullable(false);
            $table->timestamp('updated_at')->nullable(false);
            
        });
    }

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