Files
newznab-tmux/database/migrations/2018_01_20_195703_create_bookinfo_table.php
T
2019-05-07 20:56:19 +02:00

48 lines
1.4 KiB
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBookinfoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookinfo', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->charset = 'utf8';
$table->collation = 'utf8_unicode_ci';
$table->increments('id');
$table->string('title');
$table->string('author');
$table->string('asin', 128)->nullable()->unique('ix_bookinfo_asin');
$table->string('isbn', 128)->nullable();
$table->string('ean', 128)->nullable();
$table->string('url', 1000)->nullable();
$table->integer('salesrank')->unsigned()->nullable();
$table->string('publisher')->nullable();
$table->dateTime('publishdate')->nullable();
$table->string('pages', 128)->nullable();
$table->string('overview', 3000)->nullable();
$table->string('genre');
$table->boolean('cover')->default(0);
$table->timestamps();
});
DB::statement('ALTER TABLE bookinfo ADD FULLTEXT ix_bookinfo_author_title_ft (author, title)');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('bookinfo');
}
}