- Fix storage permissions to use 'www' user instead of 'www-data' - Fix UserModel getAllForAdmin query to avoid placeholders in LIMIT/OFFSET - Import missing modules: Advertising, Dashboard, Analytics - Update deploy script to copy files to public directory
41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Advertising\Database\Migrations;
|
|
|
|
use App\Core\Database\Migration;
|
|
|
|
class CreateMultiBooksTable extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$sql = "CREATE TABLE IF NOT EXISTS advertising_multibooks (
|
|
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
mb_id VARCHAR(100) NOT NULL,
|
|
brand_name VARCHAR(255) NOT NULL,
|
|
country VARCHAR(2) NOT NULL,
|
|
status ENUM('active', 'inactive', 'paused') DEFAULT 'active' NOT NULL,
|
|
settings JSON NULL,
|
|
created_by BIGINT NULL,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL,
|
|
deleted_at TIMESTAMP NULL,
|
|
INDEX idx_mb_id (mb_id),
|
|
INDEX idx_brand_name (brand_name),
|
|
INDEX idx_country (country),
|
|
INDEX idx_created_at (created_at),
|
|
INDEX idx_status (status),
|
|
UNIQUE KEY unique_mb_id (mb_id)
|
|
)";
|
|
|
|
$this->db->query($sql);
|
|
echo "✅ Created advertising_multibooks table\n";
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->db->query("DROP TABLE IF EXISTS advertising_multibooks");
|
|
echo "✅ Dropped advertising_multibooks table\n";
|
|
}
|
|
} |