Files
dredgegram/database/migrations/2026_07_12_121420_create_posts_table.php
T
dredgy d8d4ecbe8a
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s
Initial Commit
2026-08-28 21:50:26 +10:00

38 lines
1.3 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('posts', function (Blueprint $table) {
$table->string('id', 64)->primary();
$table->string('code', 64)->nullable();
$table->string('username')->nullable();
$table->string('full_name')->nullable();
$table->text('caption')->nullable();
$table->text('accessibility_caption')->nullable();
$table->boolean('is_video')->default(false);
$table->boolean('is_carousel')->default(false);
$table->integer('like_count')->nullable();
$table->integer('comment_count')->nullable();
$table->bigInteger('taken_at')->nullable(); // unix timestamp from IG
$table->text('image_url')->nullable();
$table->text('video_url')->nullable();
$table->jsonb('carousel_images')->nullable();
$table->timestamp('scraped_at')->useCurrent();
$table->text('profile_pic_url')->nullable();
$table->index('username');
$table->index('taken_at');
});
}
public function down(): void
{
Schema::dropIfExists('posts');
}
};