diff --git a/database/migrations/2024_03_30_060438_create_comment_replies_table.php b/database/migrations/2024_03_30_060438_create_comment_replies_table.php new file mode 100644 index 0000000..36f61e8 --- /dev/null +++ b/database/migrations/2024_03_30_060438_create_comment_replies_table.php @@ -0,0 +1,38 @@ +bigIncrements('id'); + $table->unsignedBigInteger('comment_id')->index(); + $table->unsignedBigInteger('video_id')->index(); + $table->unsignedBigInteger('profile_id'); + $table->text('caption')->nullable(); + $table->json('entities')->nullable(); + $table->unsignedInteger('likes')->default(0); + $table->boolean('is_edited')->default(false); + $table->boolean('is_hidden')->default(false); + $table->boolean('is_sensitive')->default(false); + $table->foreign('video_id')->references('id')->on('videos')->cascadeOnDelete(); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('comment_replies'); + } +}; diff --git a/database/migrations/2024_04_08_082610_create_followers_table.php b/database/migrations/2024_04_08_082610_create_followers_table.php new file mode 100644 index 0000000..be1a52b --- /dev/null +++ b/database/migrations/2024_04_08_082610_create_followers_table.php @@ -0,0 +1,32 @@ +id(); + $table->unsignedBigInteger('profile_id')->index(); + $table->unsignedBigInteger('following_id'); + $table->boolean('following_is_local')->default(true)->index(); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->foreign('following_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('followers'); + } +}; diff --git a/database/migrations/2024_04_25_075914_create_notifications_table.php b/database/migrations/2024_04_25_075914_create_notifications_table.php new file mode 100644 index 0000000..14bdfa2 --- /dev/null +++ b/database/migrations/2024_04_25_075914_create_notifications_table.php @@ -0,0 +1,39 @@ +bigIncrements('id'); + $table->unsignedTinyInteger('type')->index(); + $table->unsignedBigInteger('user_id')->index(); + $table->unsignedBigInteger('profile_id')->nullable(); + $table->unsignedBigInteger('video_id')->nullable(); + $table->unsignedBigInteger('comment_id')->nullable(); + $table->unsignedBigInteger('comment_reply_id')->nullable(); + $table->json('meta')->nullable(); + $table->timestamp('read_at')->nullable(); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->foreign('video_id')->references('id')->on('videos')->cascadeOnDelete(); + $table->foreign('comment_id')->references('id')->on('comments')->cascadeOnDelete(); + $table->foreign('comment_reply_id')->references('id')->on('comment_replies')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('notifications'); + } +}; diff --git a/database/migrations/2024_04_25_081009_create_video_likes_table.php b/database/migrations/2024_04_25_081009_create_video_likes_table.php new file mode 100644 index 0000000..b9ae277 --- /dev/null +++ b/database/migrations/2024_04_25_081009_create_video_likes_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->unsignedBigInteger('profile_id'); + $table->unsignedBigInteger('video_id'); + $table->unique(['profile_id', 'video_id']); + $table->foreign('video_id')->references('id')->on('videos')->cascadeOnDelete(); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('video_likes'); + } +}; diff --git a/database/migrations/2024_04_25_081015_create_comment_likes_table.php b/database/migrations/2024_04_25_081015_create_comment_likes_table.php new file mode 100644 index 0000000..fa81757 --- /dev/null +++ b/database/migrations/2024_04_25_081015_create_comment_likes_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->unsignedBigInteger('profile_id'); + $table->unsignedBigInteger('comment_id'); + $table->unique(['profile_id', 'comment_id']); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->foreign('comment_id')->references('id')->on('comments')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('comment_likes'); + } +}; diff --git a/database/migrations/2024_04_25_081348_create_comment_reply_likes_table.php b/database/migrations/2024_04_25_081348_create_comment_reply_likes_table.php new file mode 100644 index 0000000..f5d0f9e --- /dev/null +++ b/database/migrations/2024_04_25_081348_create_comment_reply_likes_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->unsignedBigInteger('profile_id'); + $table->unsignedBigInteger('comment_id'); + $table->unique(['profile_id', 'comment_id']); + $table->foreign('profile_id')->references('id')->on('profiles')->cascadeOnDelete(); + $table->foreign('comment_id')->references('id')->on('comment_reply_likes')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('comment_reply_likes'); + } +}; diff --git a/database/migrations/2024_04_27_053050_add_push_token_to_users_table.php b/database/migrations/2024_04_27_053050_add_push_token_to_users_table.php new file mode 100644 index 0000000..fef9d4c --- /dev/null +++ b/database/migrations/2024_04_27_053050_add_push_token_to_users_table.php @@ -0,0 +1,32 @@ +string('push_token')->nullable(); + $table->json('device')->nullable(); + $table->timestamp('push_token_verified_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('push_token'); + $table->dropColumn('device'); + $table->dropColumn('push_token_verified_at'); + }); + } +}; diff --git a/database/migrations/2024_08_29_090033_create_user_legacy_passwords_table.php b/database/migrations/2024_08_29_090033_create_user_legacy_passwords_table.php new file mode 100644 index 0000000..1457f7f --- /dev/null +++ b/database/migrations/2024_08_29_090033_create_user_legacy_passwords_table.php @@ -0,0 +1,29 @@ +id(); + $table->unsignedBigInteger('user_id')->unique()->index(); + $table->json('passwords')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('user_legacy_passwords'); + } +}; diff --git a/database/migrations/2024_08_29_100452_create_sounds_table.php b/database/migrations/2024_08_29_100452_create_sounds_table.php new file mode 100644 index 0000000..dcd2f5d --- /dev/null +++ b/database/migrations/2024_08_29_100452_create_sounds_table.php @@ -0,0 +1,33 @@ +id(); + $table->unsignedBigInteger('video_id'); + $table->string('sha512_hash')->nullable(); + $table->boolean('can_reshare')->default(true); + $table->string('storage_path')->nullable(); + $table->unsignedTinyInteger('version')->default(1); + $table->foreign('video_id')->references('id')->on('videos')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sounds'); + } +}; diff --git a/database/migrations/2024_08_29_100623_create_topics_table.php b/database/migrations/2024_08_29_100623_create_topics_table.php new file mode 100644 index 0000000..992649c --- /dev/null +++ b/database/migrations/2024_08_29_100623_create_topics_table.php @@ -0,0 +1,38 @@ +id(); + $table->string('name')->nullable(); + $table->string('slug')->unique()->index(); + $table->unsignedBigInteger('total_count')->default(0)->index(); + $table->text('admin_notes')->nullable(); + $table->text('public_description')->nullable(); + $table->unsignedTinyInteger('topic_rank')->default(50)->index(); + $table->json('subtopics')->nullable(); + $table->json('related_topics')->nullable(); + $table->string('icon')->nullable(); + $table->string('icon_url')->nullable(); + $table->boolean('is_active')->default(false)->index(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('topics'); + } +}; diff --git a/database/migrations/2024_08_29_100642_create_video_topics_table.php b/database/migrations/2024_08_29_100642_create_video_topics_table.php new file mode 100644 index 0000000..05edddd --- /dev/null +++ b/database/migrations/2024_08_29_100642_create_video_topics_table.php @@ -0,0 +1,32 @@ +id(); + $table->unsignedBigInteger('video_id'); + $table->json('topics')->nullable(); + $table->json('subtopics')->nullable(); + $table->json('content_filters')->nullable(); + $table->foreign('video_id')->references('id')->on('videos')->cascadeOnDelete(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('video_topics'); + } +}; diff --git a/database/migrations/2024_12_12_091621_create_videos_table.php b/database/migrations/2024_12_12_091621_create_videos_table.php deleted file mode 100644 index 4f5894b..0000000 --- a/database/migrations/2024_12_12_091621_create_videos_table.php +++ /dev/null @@ -1,56 +0,0 @@ -bigIncrements('id'); - $table->unsignedBigInteger('profile_id')->nullable()->index(); - $table->string('vid')->nullable(); - $table->text('vid_optimized')->nullable(); - $table->unsignedTinyInteger('status')->default(1)->index(); - $table->unsignedTinyInteger('duration')->nullable(); - $table->unsignedInteger('size_kb')->nullable(); - $table->text('caption')->nullable(); - $table->string('category', 50)->nullable(); - $table->json('tags')->nullable(); - $table->unsignedInteger('likes')->default(0); - $table->unsignedInteger('comments')->default(0); - $table->unsignedInteger('shares')->default(0); - $table->unsignedInteger('views')->default(0); - $table->boolean('is_sensitive')->default(false); - $table->boolean('is_adult')->default(false); - $table->boolean('has_audio')->default(true); - $table->boolean('has_thumb')->default(false); - $table->boolean('has_processed')->default(false); - $table->boolean('is_approved')->default(false)->index(); - $table->json('features')->nullable(); - $table->json('media_metadata')->nullable(); - $table->unsignedTinyInteger('comment_state')->default(4); - $table->string('cw_title')->nullable(); - $table->text('cw_body')->nullable(); - $table->string('sha512_hash')->nullable()->index(); - $table->boolean('has_hls')->default(false); - $table->boolean('can_download')->default(false); - $table->boolean('can_duet')->default(false); - $table->boolean('can_stitch')->default(false); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('videos'); - } -}; diff --git a/database/migrations/2025_02_09_082255_create_hashtags_table.php b/database/migrations/2025_02_09_082255_create_hashtags_table.php new file mode 100644 index 0000000..5671f85 --- /dev/null +++ b/database/migrations/2025_02_09_082255_create_hashtags_table.php @@ -0,0 +1,35 @@ +id(); + $table->string('name', 191)->unique(); + $table->string('name_normalized', 191)->unique(); + $table->boolean('can_trend')->default(false)->index(); + $table->boolean('can_search')->default(true); + $table->boolean('can_autolink')->default(true); + $table->boolean('is_nsfw')->default(false); + $table->boolean('is_banned')->default(false); + $table->unsignedBigInteger('count')->default(0); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('hashtags'); + } +}; diff --git a/database/migrations/2025_02_09_082309_create_video_hashtags_table.php b/database/migrations/2025_02_09_082309_create_video_hashtags_table.php new file mode 100644 index 0000000..1cd0ed8 --- /dev/null +++ b/database/migrations/2025_02_09_082309_create_video_hashtags_table.php @@ -0,0 +1,29 @@ +id(); + $table->foreignId('video_id')->constrained()->onDelete('cascade'); + $table->foreignId('hashtag_id')->constrained()->onDelete('cascade'); + $table->unique(['video_id', 'hashtag_id']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('video_hashtags'); + } +}; diff --git a/database/migrations/2025_06_22_103001_create_personal_access_tokens_table.php b/database/migrations/2025_06_22_103001_create_personal_access_tokens_table.php new file mode 100644 index 0000000..e828ad8 --- /dev/null +++ b/database/migrations/2025_06_22_103001_create_personal_access_tokens_table.php @@ -0,0 +1,33 @@ +id(); + $table->morphs('tokenable'); + $table->string('name'); + $table->string('token', 64)->unique(); + $table->text('abilities')->nullable(); + $table->timestamp('last_used_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('personal_access_tokens'); + } +};