You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('books', function (Blueprint $table) {
$table->comment('图书表');
$table->increments('id');
$table->string('title')->comment('书名');
// 书架
$table->string('bookshelf')->comment('书架');
$table->string('author')->nullable()->comment('作者');
$table->string('isbn')->nullable()->comment('ISBN');
$table->string('publisher')->nullable()->comment('出版社');
$table->string('publish_year')->nullable()->comment('出版年份');
$table->string('category')->nullable()->comment('分类');
$table->mediumText('description')->nullable()->comment('图书简介');
$table->integer('cover_id')->nullable()->comment('图书封面');
$table->tinyInteger('status')->default(0)->comment('状态0可借阅1已借出2维护中');
$table->json('other_data')->nullable()->comment('其他数据');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('books');
}
};