- Created separate MoneyFlix project directory - Copied Node.js redirector from production server - Added CRM PHP code (Redirects module, Core classes, Config, Routes, Views) - Created comprehensive documentation (README_MONEYFLIX.md) - Added sync script to keep CRM code updated (sync-from-crm.sh) - Configured .gitignore for Node.js and PHP - Set up proper project structure for multi-client isolation This separates MoneyFlix from the main CRM to avoid confusion between different client systems and provides a dedicated environment for MoneyFlix-specific development and maintenance.
52 lines
2.0 KiB
PHP
52 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Core\Database\Migrations;
|
|
|
|
use App\Core\Database\Migration;
|
|
|
|
/**
|
|
* Create Landing Templates Table
|
|
*
|
|
* Tabela para gerir templates de landing por marca/país
|
|
* 1 template = 1 imagem por marca/país = Infinitos trackers
|
|
*/
|
|
class CreateLandingTemplatesTable extends Migration
|
|
{
|
|
protected ?string $connection = null;
|
|
|
|
public function up(): void
|
|
{
|
|
$this->db->query("
|
|
CREATE TABLE IF NOT EXISTS advertising_landing_templates (
|
|
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
cuid VARCHAR(64) NOT NULL UNIQUE,
|
|
brand_id BIGINT(20) UNSIGNED NOT NULL,
|
|
country_code VARCHAR(10) NOT NULL,
|
|
template_type VARCHAR(50) NOT NULL DEFAULT 'banner',
|
|
image_path VARCHAR(500) NOT NULL,
|
|
mobile_image_path VARCHAR(500) NULL,
|
|
desktop_image_path VARCHAR(500) NULL,
|
|
is_active TINYINT(1) NOT NULL DEFAULT 1,
|
|
created_by BIGINT(20) NOT NULL DEFAULT 1,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
deleted_at TIMESTAMP NULL,
|
|
PRIMARY KEY (id),
|
|
INDEX idx_brand_country (brand_id, country_code),
|
|
INDEX idx_template_type (template_type),
|
|
INDEX idx_is_active (is_active),
|
|
INDEX idx_created_by (created_by),
|
|
INDEX idx_deleted_at (deleted_at),
|
|
FOREIGN KEY (brand_id) REFERENCES advertising_brands(id) ON DELETE CASCADE,
|
|
UNIQUE KEY unique_brand_country_type (brand_id, country_code, template_type)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
|
");
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->db->query("DROP TABLE IF EXISTS advertising_landing_templates");
|
|
}
|
|
}
|