mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
Stuff i guess ?
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user