latest update
This commit is contained in:
1 parent
9ad842dcd5
commit
062c0e896f
42 files changed
+7052
-2921
No files matched your search
@@ -0,0 +1,48 @@
|
||||
<?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::table('users', function (Blueprint $table) {
|
||||
$table->string('bio')->nullable()->after('avatar');
|
||||
$table->string('website')->nullable()->after('bio');
|
||||
$table->string('twitter')->nullable()->after('website');
|
||||
$table->string('instagram')->nullable()->after('twitter');
|
||||
$table->string('facebook')->nullable()->after('instagram');
|
||||
$table->string('youtube')->nullable()->after('facebook');
|
||||
$table->string('linkedin')->nullable()->after('youtube');
|
||||
$table->string('tiktok')->nullable()->after('linkedin');
|
||||
$table->date('birthday')->nullable()->after('tiktok');
|
||||
$table->string('location')->nullable()->after('birthday');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'bio',
|
||||
'website',
|
||||
'twitter',
|
||||
'instagram',
|
||||
'facebook',
|
||||
'youtube',
|
||||
'linkedin',
|
||||
'tiktok',
|
||||
'birthday',
|
||||
'location'
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->boolean('is_shorts')->default(false)->after('type');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropColumn('is_shorts');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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('playlists', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('thumbnail')->nullable();
|
||||
$table->enum('visibility', ['public', 'private'])->default('private');
|
||||
$table->boolean('is_default')->default(false); // For "Watch Later" default playlist
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['user_id', 'visibility']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('playlists');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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('playlist_videos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('playlist_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('video_id')->constrained()->onDelete('cascade');
|
||||
$table->integer('position')->default(0); // For ordering videos in playlist
|
||||
$table->timestamp('added_at')->useCurrent();
|
||||
// Watch progress - remember where user left off
|
||||
$table->integer('watched_seconds')->default(0);
|
||||
$table->boolean('watched')->default(false);
|
||||
$table->timestamp('last_watched_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['playlist_id', 'video_id']);
|
||||
$table->index(['playlist_id', 'position']);
|
||||
$table->index(['video_id', 'last_watched_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('playlist_videos');
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user