<?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 Version20211118081320 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE shop_example (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, link VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, pos INTEGER NOT NULL, description CLOB DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, updated_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
)');
//$this->addSql('DROP INDEX IDX_ECBAF226AFC2B591');
//$this->addSql('CREATE TEMPORARY TABLE __temp__module_attachment AS SELECT id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions FROM module_attachment');
//$this->addSql('DROP TABLE module_attachment');
//$this->addSql('CREATE TABLE module_attachment (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, module_id INTEGER DEFAULT NULL, updated_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
//, image_name VARCHAR(255) DEFAULT NULL COLLATE BINARY, image_original_name VARCHAR(255) DEFAULT NULL COLLATE BINARY, image_mime_type VARCHAR(255) DEFAULT NULL COLLATE BINARY, image_size INTEGER DEFAULT NULL, image_dimensions CLOB DEFAULT NULL COLLATE BINARY --(DC2Type:simple_array)
//, CONSTRAINT FK_ECBAF226AFC2B591 FOREIGN KEY (module_id) REFERENCES module_page (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
//$this->addSql('INSERT INTO module_attachment (id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions) SELECT id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions FROM __temp__module_attachment');
//$this->addSql('DROP TABLE __temp__module_attachment');
//$this->addSql('CREATE INDEX IDX_ECBAF226AFC2B591 ON module_attachment (module_id)');
$this->addSql('ALTER TABLE module_page ADD COLUMN pos INTEGER DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE shop_example');
//$this->addSql('DROP INDEX IDX_ECBAF226AFC2B591');
//$this->addSql('CREATE TEMPORARY TABLE __temp__module_attachment AS SELECT id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions FROM module_attachment');
//$this->addSql('DROP TABLE module_attachment');
//$this->addSql('CREATE TABLE module_attachment (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, module_id INTEGER DEFAULT NULL, updated_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
//, image_name VARCHAR(255) DEFAULT NULL, image_original_name VARCHAR(255) DEFAULT NULL, image_mime_type VARCHAR(255) DEFAULT NULL, image_size INTEGER DEFAULT NULL, image_dimensions CLOB DEFAULT NULL --(DC2Type:simple_array)
//)');
//$this->addSql('INSERT INTO module_attachment (id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions) SELECT id, module_id, updated_at, created_at, image_name, image_original_name, image_mime_type, image_size, image_dimensions FROM __temp__module_attachment');
//$this->addSql('DROP TABLE __temp__module_attachment');
//$this->addSql('CREATE INDEX IDX_ECBAF226AFC2B591 ON module_attachment (module_id)');
//$this->addSql('DROP INDEX UNIQ_AE36F32C989D9B62');
$this->addSql('CREATE TEMPORARY TABLE __temp__module_page AS SELECT id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, feature_text, feature_image, created_at, updated_at, feature_btn_text, active, feature_you_tube, page_title, meta_description FROM module_page');
$this->addSql('DROP TABLE module_page');
$this->addSql('CREATE TABLE module_page (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, slug VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, description CLOB NOT NULL, capability_title VARCHAR(255) DEFAULT NULL, capability_text CLOB DEFAULT NULL, configure_title VARCHAR(255) DEFAULT NULL, configure_text CLOB DEFAULT NULL, tariffs CLOB NOT NULL --(DC2Type:json)
, feature_text CLOB DEFAULT NULL, feature_image VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL --(DC2Type:datetime_immutable)
, updated_at DATETIME DEFAULT NULL, feature_btn_text VARCHAR(255) DEFAULT NULL, active BOOLEAN NOT NULL, feature_you_tube VARCHAR(255) DEFAULT NULL, page_title VARCHAR(255) DEFAULT \'\' NOT NULL, meta_description VARCHAR(255) DEFAULT \'\' NOT NULL)');
$this->addSql('INSERT INTO module_page (id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, feature_text, feature_image, created_at, updated_at, feature_btn_text, active, feature_you_tube, page_title, meta_description) SELECT id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, feature_text, feature_image, created_at, updated_at, feature_btn_text, active, feature_you_tube, page_title, meta_description FROM __temp__module_page');
$this->addSql('DROP TABLE __temp__module_page');
$this->addSql('CREATE UNIQUE INDEX UNIQ_AE36F32C989D9B62 ON module_page (slug)');
}
}