Skip to content

Commit

Permalink
fix: add unique index to uuid videos
Browse files Browse the repository at this point in the history
  • Loading branch information
abourtnik committed Jan 20, 2024
1 parent 1663e67 commit 4962c0b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions database/migrations/2024_01_20_202136_add_index_to_uuid_videos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::table('videos', function (Blueprint $table) {
$table->unique('uuid', 'videos_uuid_unique');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('videos', function (Blueprint $table) {
$table->dropIndex('videos_uuid_unique');
});
}
};

0 comments on commit 4962c0b

Please sign in to comment.