Stuff i guess ?

This commit is contained in:
Lars Behrends
2025-10-31 00:24:17 +01:00
parent db0fd4e728
commit 04140786a7
40 changed files with 5411 additions and 525 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Database\Migrations;
use App\Database\Migration;
class CreateAdultVideoActorTables extends Migration
{
public function up()
{
// Create adult_video_actor pivot table
$this->pdo->exec("
CREATE TABLE IF NOT EXISTS adult_video_actor (
id INT AUTO_INCREMENT PRIMARY KEY,
adult_video_id INT NOT NULL,
actor_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (adult_video_id) REFERENCES adult_videos(id) ON DELETE CASCADE,
FOREIGN KEY (actor_id) REFERENCES actors(id) ON DELETE CASCADE,
UNIQUE KEY unique_adult_video_actor (adult_video_id, actor_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
");
}
public function down()
{
$this->pdo->exec("DROP TABLE IF EXISTS adult_video_actor");
}
}