takeone-youtube-clone/database/migrations/2026_02_23_000000_create_videos_table.php
ghassan 5253f89b63 Add video platform features: authentication, video management, user profiles, likes/views tracking
- Added authentication controllers (Login, Register)
- Added UserController for user profile management
- Added VideoController with full CRUD operations
- Added Video model with relationships (user, likes, views)
- Added User model enhancements (avatar, video relationships)
- Added database migrations for video_likes, video_views, user_avatar, video_visibility
- Added CompressVideoJob for video processing
- Added VideoUploaded mail notification
- Added authentication routes
- Updated web routes with video and user routes
- Added layout templates (app, plain, partials)
- Added user views (profile, settings, channel, history, liked)
- Added video views (create, edit, index, show)
- Added email templates
2026-02-25 00:03:02 +00:00

35 lines
1.2 KiB
PHP
Executable File

<?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::create('videos', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->string('title');
$table->text('description')->nullable();
$table->string('filename');
$table->string('path');
$table->string('thumbnail')->nullable();
$table->integer('duration')->default(0);
$table->bigInteger('size')->default(0);
$table->string('mime_type')->nullable();
$table->enum('orientation', ['landscape', 'portrait', 'square', 'ultrawide'])->default('landscape');
$table->integer('width')->nullable();
$table->integer('height')->nullable();
$table->enum('status', ['pending', 'processing', 'ready', 'failed'])->default('pending');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('videos');
}
};