<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250602134955 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$now = (new \DateTime())->format('Y-m-d H:i:s');
// Insert menu options
$this->addSql("
INSERT INTO std_options (created_by, updated_by, machine_name, order_value, path, is_active, created_date, updated_date, menu_section, dropdown_section, icon, name, external_link)
VALUES
-- Header: Areas
(1, 1, 'see_website', 1, null, 1, '$now', '$now', 'areas', null, 'web', 'see_website', '/'),
(1, 1, 'workspace', 2, 'admin_workspace', 1, '$now', '$now', 'areas', null, 'device-desktop', 'workspace', null),
(1, 1, 'studiohelp', 3, null, 1, '$now', '$now', 'areas', null, 'information', 'studiohelp', 'https://studio.help.fullscreen.pt'),
-- Navigation
(1, 1, 'navigation', 4, 'admin_navigation_initial_relation', 1, '$now', '$now', 'navigation', null, 'network-1', 'navigation', null),
-- Approvals
(1, 1, 'approval_workflow', 4, 'admin_approvals', 1, '$now', '$now', 'navigation', null, 'search', 'approval_workflow', null),
-- Content
(1, 1, 'pages', 5, null, 1, '$now', '$now', 'navigation', 'content', 'blog', 'pages', '/admin/content/pages'),
(1, 1, 'posts', 6, null, 1, '$now', '$now', 'navigation', 'content', 'blog', 'posts', '/admin/content/posts'),
(1, 1, 'landing_pages', 7, null, 1, '$now', '$now', 'navigation', 'content', 'blog', 'landing_pages', '/admin/content/landing_pages'),
(1, 1, 'modals', 8, null, 1, '$now', '$now', 'navigation', 'content', 'blog', 'modals', '/admin/content/modals'),
(1, 1, 'content_snippets', 9, 'admin_snippets', 1, '$now', '$now', 'navigation', 'content', 'blog', 'content_snippets', null),
(1, 1, 'pages_categories', 10, null, 1, '$now', '$now', 'navigation', null, 'network-1', 'categories', '/admin/content/pages_categories'),
(1, 1, 'seo', 11, 'admin_seo', 1, '$now', '$now', 'navigation', null, 'graph-line', 'seo', null),
(1, 1, 'system', 12, null, 1, '$now', '$now', 'navigation', null, 'gear', 'system', '/admin/content/system'),
-- Forms
(1, 1, 'all_forms', 13, null, 1, '$now', '$now', 'navigation', 'forms', 'document', 'all_forms', '/admin/content/forms'),
(1, 1, 'submitted_forms', 14, null, 1, '$now', '$now', 'navigation', 'forms', 'document', 'submitted_forms', '/admin/forms'),
-- Domains & Webservices
(1, 1, 'domains', 15, 'admin_domains', 1, '$now', '$now', 'navigation', null, 'network-3', 'domains', null),
(1, 1, 'webservices', 16, 'admin_webservices', 1, '$now', '$now', 'navigation', null, 'browser-upload', 'webservices', null),
-- Menus & Templates
(1, 1, 'menus', 17, 'admin_menus', 1, '$now', '$now', 'navigation', null, 'view-list', 'menus', null),
(1, 1, 'templates', 18, 'admin_templates', 1, '$now', '$now', 'navigation', null, 'align-left', 'templates', null),
(1, 1, 'attributes', 19, 'admin_attributes', 1, '$now', '$now', 'navigation', null, 'checklist', 'attributes', null),
-- Notifications
(1, 1, 'notifications', 20, 'admin_notifications', 1, '$now', '$now', 'navigation', 'notifications', 'mail', 'all_notifications', null),
(1, 1, 'emails_config', 21, 'admin_emails_configurations', 1, '$now', '$now', 'navigation', 'notifications', 'gear', 'all_emails_configurations', null),
-- Filemanager
(1, 1, 'filemanager', 22, null, 1, '$now', '$now', 'navigation', null, 'archive', 'file_manager', '/admin/filemanager/?conf=default'),
-- Translations
(1, 1, 'languages', 23, 'admin_languages_list', 1, '$now', '$now', 'navigation', 'translations', 'web', 'languages', null),
(1, 1, 'translations', 24, 'admin_translations', 1, '$now', '$now', 'navigation', 'translations', 'web', 'translations', null),
(1, 1, 'add_translation', 25, 'admin_translations_new', 1, '$now', '$now', 'navigation', 'translations', 'web', 'add_new', null),
(1, 1, 'refresh_labels', 26, null, 1, '$now', '$now', 'navigation', 'translations', 'web', 'refresh_labels', '/admin/translations/refresh'),
-- Scheduler
(1, 1, 'scheduler_tasks', 27, 'scheduler_tasks', 1, '$now', '$now', 'navigation', 'scheduled_tasks', 'clock', 'list_scheduled_tasks', null),
(1, 1, 'scheduler_tasks_new', 27, 'scheduler_tasks_new', 1, '$now', '$now', 'navigation', 'scheduled_tasks', 'clock', 'add_scheduled_tasks', null),
-- Cache
(1, 1, 'clear_html_cache', 28, null, 1, '$now', '$now', 'administration', 'cache', 'clockwise', 'clear_html_cache', '/admin/cache/clear'),
(1, 1, 'clear_liip_cache', 29, null, 1, '$now', '$now', 'administration', 'cache', 'clockwise', 'clear_liip_cache', '/admin/liip/cache/clear'),
-- Users
(1, 1, 'users', 30, 'admin_users', 1, '$now', '$now', 'administration', null, 'user-group', 'users', null),
(1, 1, 'delete_user_data', 31, 'admin_delete_user_data', 1, '$now', '$now', 'administration', null, 'user-group', 'delete_user_data', null),
-- Redirects
(1, 1, 'redirects', 32, 'admin_redirects', 1, '$now', '$now', 'administration', null, 'skip', 'redirects', null),
-- Emails Log
(1, 1, 'emails_log_all', 33, 'admin_emailslog', 1, '$now', '$now', 'administration', 'emails_log', 'mail', 'all_emails_log', null),
(1, 1, 'emails_log_error', 34, 'admin_emailslog_with_error', 1, '$now', '$now', 'administration', 'emails_log', 'mail', 'emails_log_error', null),
-- Settings
(1, 1, 'settings', 35, 'admin_config', 1, '$now', '$now', 'administration', null, 'toggles', 'settings', null),
(1, 1, 'roles', 36, 'admin_roles', 1, '$now', '$now', 'administration', null, 'user-group', 'permissions', null),
-- Super Admin
(1, 1, 'feature_flag', 37, 'admin_feature_flag_list', 1, '$now', '$now', 'administration', null, 'flag', 'feature_flag', null),
(1, 1, 'master_config', 38, 'admin_masterconfig', 1, '$now', '$now', 'administration', null, 'toggles', 'master_config', null);
");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE cache_items');
$this->addSql('ALTER TABLE std_config CHANGE roles roles JSON DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX idx_machine_name ON std_content_types (machine_name)');
$this->addSql('ALTER TABLE std_cookies CHANGE webuser_id webuser_id INT UNSIGNED DEFAULT NULL COMMENT \'Web user unique identifider\', CHANGE funcional_accepted funcional_accepted TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Funcional cookies accepted\'');
$this->addSql('ALTER TABLE std_diary CHANGE created_by created_by INT UNSIGNED DEFAULT NULL, CHANGE updated_by updated_by INT UNSIGNED DEFAULT NULL, CHANGE type type VARCHAR(255) CHARACTER SET utf8mb3 NOT NULL COLLATE `utf8mb3_general_ci`, CHANGE subtype subtype VARCHAR(255) CHARACTER SET utf8mb3 NOT NULL COLLATE `utf8mb3_general_ci`');
$this->addSql('ALTER TABLE std_diary RENAME INDEX idx_d245bcffde12ab56 TO FK_CreatedByUser');
$this->addSql('ALTER TABLE std_diary RENAME INDEX idx_d245bcff16fe72e1 TO FK_UpdatedByUser');
$this->addSql('ALTER TABLE std_domains_values DROP FOREIGN KEY FK_3A0935D7115F0EE5');
$this->addSql('ALTER TABLE std_domains_values ADD CONSTRAINT FK_3A0935D7115F0EE5 FOREIGN KEY (domain_id) REFERENCES std_domains (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE std_domains_values_content CHANGE language_code language_code VARCHAR(2) NOT NULL');
$this->addSql('ALTER TABLE std_domains_values_content RENAME INDEX idx_b090d5cb451cdad4 TO FK_std_domains_values_content_std_languages');
$this->addSql('CREATE INDEX idx_address ON std_emails_log (toaddress(100))');
$this->addSql('CREATE INDEX idx_created ON std_emails_log (created_at)');
$this->addSql('ALTER TABLE std_feature_flag CHANGE info info JSON NOT NULL COMMENT \'info of feature flag\'');
$this->addSql('ALTER TABLE std_languages CHANGE order_value order_value INT DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX locale ON std_languages (locale)');
$this->addSql('ALTER TABLE std_options DROP dropdown_section');
$this->addSql('ALTER TABLE std_pages CHANGE machine_name machine_name VARCHAR(255) DEFAULT NULL COMMENT \'Page machine name\'');
$this->addSql('ALTER TABLE std_pages_content CHANGE meta_description meta_description VARCHAR(4000) DEFAULT NULL COMMENT \'Meta description of the page\', CHANGE og_description og_description VARCHAR(4000) DEFAULT NULL, CHANGE scripts_head scripts_head TEXT DEFAULT NULL COMMENT \'Scripts to add to the head of the page\', CHANGE scripts_body scripts_body TEXT DEFAULT NULL COMMENT \'Scripts to add to the body of the page\', CHANGE scripts_footer scripts_footer TEXT DEFAULT NULL COMMENT \'Scripts to add to the footer of the page\'');
$this->addSql('ALTER TABLE std_scheduler_commands CHANGE is_stoppable is_stoppable TINYINT(1) DEFAULT 0 COMMENT \'Flag that indictes if command can be stopped manually while running\'');
$this->addSql('CREATE UNIQUE INDEX machine_name ON std_scheduler_commands (machine_name)');
$this->addSql('ALTER TABLE std_scheduler_tasks CHANGE scheduler_command_id scheduler_command_id INT UNSIGNED NOT NULL COMMENT \'Command unique identifier\', CHANGE created_by created_by INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', CHANGE updated_by updated_by INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', CHANGE status status SMALLINT DEFAULT NULL COMMENT \'null - Never executed, 0 - running, -1 - error, 1 - success, 2 stopped\', CHANGE force_stop force_stop TINYINT(1) DEFAULT 0 COMMENT \'Flag that indictes the task should stop immediatly\', CHANGE force_start force_start TINYINT(1) DEFAULT 0 COMMENT \'Flag that indictes the task should start immediatly\', CHANGE is_deleted is_deleted TINYINT(1) DEFAULT 0 COMMENT \'Flag that indicates if the task is deleted\'');
$this->addSql('ALTER TABLE std_seo_benchmark CHANGE missing_content missing_content LONGTEXT DEFAULT NULL, CHANGE checked_pages checked_pages LONGTEXT DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX label_domain ON std_translations (label, domain)');
$this->addSql('DROP INDEX translation_id_language_code ON std_translations_content');
$this->addSql('ALTER TABLE std_translations_content CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Unique Identifier\', CHANGE translation_id translation_id INT UNSIGNED NOT NULL COMMENT \'Translation ID from table std_translations\', CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\', CHANGE content content VARCHAR(8000) DEFAULT NULL COMMENT \'ISO 639 Translation\'');
$this->addSql('CREATE UNIQUE INDEX translation_id_language_code ON std_translations_content (translation_id, language_code)');
$this->addSql('ALTER TABLE std_translations_content RENAME INDEX idx_5507c9d451cdad4 TO FK_std_translations_content_std_languages');
}
}