Done
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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('articles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('feed_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('guid'); // <guid> or Atom <id>, this is what dedupes
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('link');
|
||||
$table->string('author')->nullable();
|
||||
$table->string('image_url')->nullable();
|
||||
$table->timestamp('published_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['feed_id', 'guid']);
|
||||
$table->index(['feed_id', 'published_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('articles');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user