Add (article): ai gen, front views

This commit is contained in:
2023-09-24 22:53:40 +08:00
parent 18705bd5e4
commit 322d680961
115 changed files with 9710 additions and 201 deletions

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title')->nullable();
$table->string('short_title')->nullable();
$table->string('slug')->nullable();
$table->string('type')->nullable();
$table->string('main_keyword')->nullable();
$table->json('keywords')->nullable();
$table->mediumText('excerpt')->nullable();
$table->foreignId('author_id')->nullable();
$table->boolean('featured')->default(false);
$table->string('featured_image')->nullable();
$table->text('body')->nullable();
$table->integer('views_count')->default(0);
$table->enum('status', ['publish', 'future', 'draft', 'private', 'trash'])->default('draft');
$table->timestamp('published_at')->nullable();
$table->timestamps();
$table->foreign('author_id')->references('id')->on('authors');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('posts');
}
};