Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions database/migrations/2018_03_31_104532_create_media_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class CreateMediaTable extends Migration
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->increments('id');
$table->id();
$table->timestamps();
$table->string('link');
$table->string('name')->unique();
$table->boolean('is_public')->default(false);
$table->integer('owner_id')->nullable();
$table->string('preview_id')->nullable();
$table->foreignId('preview_id')->nullable();
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The foreignId('preview_id') method creates a BIGINT UNSIGNED column, while the original string('preview_id') created a VARCHAR column. This is a breaking change that could cause data type mismatches if existing data contains non-numeric preview IDs or if related tables expect string foreign keys.

Suggested change
$table->foreignId('preview_id')->nullable();
$table->string('preview_id')->nullable();

Copilot uses AI. Check for mistakes.


if (config('database.default') == 'mysql') {
$table->jsonb('meta')->nullable();
Expand Down