👁 查看:2026_06_25_162332_create_newspapers_table.php
路径:/home/boguraj1/.trash/database.1/migrations/2026_06_25_162332_create_newspapers_table.php
大小:938 B · 修改:2026-06-25 22:24:08 · 权限:0644 · 可写
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewspapersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('newspapers', function (Blueprint $table) {
$table->id();
$table->date('publish_date')->unique();
$table->string('edition_name')->nullable();
$table->string('volume')->nullable();
$table->string('issue_number')->nullable();
$table->enum('status', ['draft', 'published'])->default('published');
$table->text('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('newspapers');
}
}