Skip to content

Commit 567b72f

Browse files
committed
feat: implement subtitles table
1 parent 7b245ec commit 567b72f

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration {
8+
/**
9+
* Run the migrations.
10+
*/
11+
public function up(): void {
12+
Schema::create('subtitles', function (Blueprint $table) {
13+
$table->id();
14+
15+
$table->foreignUuid('metadata_uuid')->constrained('metadata', 'uuid')->cascadeOnDelete();
16+
$table->unsignedSmallInteger('track_id');
17+
$table->string('language', 16)->nullable();
18+
$table->string('codec', 32)->nullable();
19+
$table->string('format', 16)->nullable();
20+
$table->string('path')->nullable();
21+
22+
$table->timestamps();
23+
24+
$table->index(['metadata_uuid']);
25+
$table->unique(['metadata_uuid', 'track_id']);
26+
});
27+
}
28+
29+
/**
30+
* Reverse the migrations.
31+
*/
32+
public function down(): void {
33+
Schema::dropIfExists('subtitles');
34+
}
35+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration {
8+
/**
9+
* Run the migrations.
10+
*/
11+
public function up(): void {
12+
Schema::table('metadata', function (Blueprint $table) {
13+
$table->timestamp('subtitles_scanned_at')->nullable();
14+
});
15+
}
16+
17+
/**
18+
* Reverse the migrations.
19+
*/
20+
public function down(): void {
21+
Schema::table('metadata', function (Blueprint $table) {
22+
$table->dropColumn('subtitles_scanned_at');
23+
});
24+
}
25+
};

0 commit comments

Comments
 (0)