<?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 Version20220919153513 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 vehicle (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, model_year VARCHAR(7) NOT NULL, total_drived INTEGER NOT NULL, fuel_type VARCHAR(10) NOT NULL, transmission VARCHAR(50) NOT NULL, engine_capacity INTEGER NOT NULL, category VARCHAR(20) NOT NULL, maker VARCHAR(50) NOT NULL, price NUMERIC(10, 2) NOT NULL)');
$this->addSql('CREATE TEMPORARY TABLE __temp__album AS SELECT id FROM album');
$this->addSql('DROP TABLE album');
$this->addSql('CREATE TABLE album (id INTEGER NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_39986E43BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO album (id) SELECT id FROM __temp__album');
$this->addSql('DROP TABLE __temp__album');
$this->addSql('CREATE TEMPORARY TABLE __temp__article AS SELECT id FROM article');
$this->addSql('DROP TABLE article');
$this->addSql('CREATE TABLE article (id INTEGER NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_23A0E66BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO article (id) SELECT id FROM __temp__article');
$this->addSql('DROP TABLE __temp__article');
$this->addSql('CREATE TEMPORARY TABLE __temp__artist AS SELECT id, genre FROM artist');
$this->addSql('DROP TABLE artist');
$this->addSql('CREATE TABLE artist (id INTEGER NOT NULL, genre VARCHAR(255) NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_1599687BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO artist (id, genre) SELECT id, genre FROM __temp__artist');
$this->addSql('DROP TABLE __temp__artist');
$this->addSql('DROP INDEX IDX_187D3695B7970CF8');
$this->addSql('CREATE TEMPORARY TABLE __temp__audio AS SELECT id, artist_id, price, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id FROM audio');
$this->addSql('DROP TABLE audio');
$this->addSql('CREATE TABLE audio (id INTEGER NOT NULL, artist_id INTEGER NOT NULL, price NUMERIC(10, 2) DEFAULT NULL, duration VARCHAR(10) NOT NULL, featured_by VARCHAR(255) DEFAULT NULL, produced_by VARCHAR(255) NOT NULL, distributed_by VARCHAR(255) DEFAULT NULL, primary_file VARCHAR(255) NOT NULL, secondary_file VARCHAR(150) DEFAULT NULL, released_at DATE DEFAULT NULL, purchase_url VARCHAR(255) DEFAULT NULL, resumable_id VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_187D3695B7970CF8 FOREIGN KEY (artist_id) REFERENCES artist (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_187D3695BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO audio (id, artist_id, price, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id) SELECT id, artist_id, price, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id FROM __temp__audio');
$this->addSql('DROP TABLE __temp__audio');
$this->addSql('CREATE INDEX IDX_187D3695B7970CF8 ON audio (artist_id)');
$this->addSql('DROP INDEX IDX_B4FA1177E2C35FC');
$this->addSql('DROP INDEX IDX_B4FA1177A76ED395');
$this->addSql('DROP INDEX UNIQ_B4FA1177989D9B62');
$this->addSql('DROP INDEX UNIQ_B4FA1177E3C68343');
$this->addSql('CREATE TEMPORARY TABLE __temp__contents AS SELECT id, term_id, user_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, content_type, updated_at, position FROM contents');
$this->addSql('DROP TABLE contents');
$this->addSql('CREATE TABLE contents (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, term_id INTEGER DEFAULT NULL, user_id INTEGER NOT NULL, unique_id VARCHAR(255) DEFAULT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, summary CLOB DEFAULT NULL, body CLOB DEFAULT NULL, thumbnail VARCHAR(255) DEFAULT NULL, status VARCHAR(20) NOT NULL, is_featured BOOLEAN DEFAULT NULL, promoted BOOLEAN DEFAULT NULL, publish_on_socialmedia BOOLEAN DEFAULT NULL, is_published_social_media BOOLEAN DEFAULT NULL, is_home BOOLEAN DEFAULT NULL, date_created DATETIME NOT NULL, date_published DATETIME DEFAULT NULL, meta_keywords VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, content_type VARCHAR(255) NOT NULL, updated_at DATETIME DEFAULT NULL, position INTEGER DEFAULT NULL, CONSTRAINT FK_B4FA1177A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_B4FA1177E2C35FC FOREIGN KEY (term_id) REFERENCES taxonomy_term (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO contents (id, term_id, user_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, content_type, updated_at, position) SELECT id, term_id, user_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, content_type, updated_at, position FROM __temp__contents');
$this->addSql('DROP TABLE __temp__contents');
$this->addSql('CREATE INDEX IDX_B4FA1177E2C35FC ON contents (term_id)');
$this->addSql('CREATE INDEX IDX_B4FA1177A76ED395 ON contents (user_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B4FA1177989D9B62 ON contents (slug)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B4FA1177E3C68343 ON contents (unique_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__document AS SELECT id, extension, file_name FROM document');
$this->addSql('DROP TABLE document');
$this->addSql('CREATE TABLE document (id INTEGER NOT NULL, extension VARCHAR(20) DEFAULT NULL, file_name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_D8698A76BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO document (id, extension, file_name) SELECT id, extension, file_name FROM __temp__document');
$this->addSql('DROP TABLE __temp__document');
$this->addSql('CREATE TEMPORARY TABLE __temp__events AS SELECT id, event_venue, event_date, is_register_require, end_date, price, event_time, country FROM events');
$this->addSql('DROP TABLE events');
$this->addSql('CREATE TABLE events (id INTEGER NOT NULL, event_venue VARCHAR(255) NOT NULL, event_date DATETIME DEFAULT NULL, is_register_require BOOLEAN DEFAULT NULL, end_date DATETIME DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL, event_time VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_5387574ABF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO events (id, event_venue, event_date, is_register_require, end_date, price, event_time, country) SELECT id, event_venue, event_date, is_register_require, end_date, price, event_time, country FROM __temp__events');
$this->addSql('DROP TABLE __temp__events');
$this->addSql('DROP INDEX IDX_6A2CA10C84A0A3ED');
$this->addSql('CREATE TEMPORARY TABLE __temp__media AS SELECT id, content_id, title, mime_type, file_name, created_at, updated_at FROM media');
$this->addSql('DROP TABLE media');
$this->addSql('CREATE TABLE media (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, content_id INTEGER DEFAULT NULL, title VARCHAR(255) NOT NULL, mime_type VARCHAR(150) NOT NULL, file_name VARCHAR(100) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, CONSTRAINT FK_6A2CA10C84A0A3ED FOREIGN KEY (content_id) REFERENCES contents (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO media (id, content_id, title, mime_type, file_name, created_at, updated_at) SELECT id, content_id, title, mime_type, file_name, created_at, updated_at FROM __temp__media');
$this->addSql('DROP TABLE __temp__media');
$this->addSql('CREATE INDEX IDX_6A2CA10C84A0A3ED ON media (content_id)');
$this->addSql('DROP INDEX IDX_52EA1F098D9F6D38');
$this->addSql('DROP INDEX IDX_52EA1F094584665A');
$this->addSql('CREATE TEMPORARY TABLE __temp__order_item AS SELECT order_id, product_id, price, quantity, license FROM order_item');
$this->addSql('DROP TABLE order_item');
$this->addSql('CREATE TABLE order_item (order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, price NUMERIC(10, 0) DEFAULT NULL, quantity NUMERIC(10, 0) DEFAULT NULL, license VARCHAR(10) DEFAULT NULL, PRIMARY KEY(order_id, product_id), CONSTRAINT FK_52EA1F098D9F6D38 FOREIGN KEY (order_id) REFERENCES orders (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_52EA1F094584665A FOREIGN KEY (product_id) REFERENCES audio (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO order_item (order_id, product_id, price, quantity, license) SELECT order_id, product_id, price, quantity, license FROM __temp__order_item');
$this->addSql('DROP TABLE __temp__order_item');
$this->addSql('CREATE INDEX IDX_52EA1F098D9F6D38 ON order_item (order_id)');
$this->addSql('CREATE INDEX IDX_52EA1F094584665A ON order_item (product_id)');
$this->addSql('DROP INDEX UNIQ_140AB62034ECB4E6');
$this->addSql('CREATE TEMPORARY TABLE __temp__page AS SELECT id, route_id, parent_id FROM page');
$this->addSql('DROP TABLE page');
$this->addSql('CREATE TABLE page (id INTEGER NOT NULL, route_id INTEGER DEFAULT NULL, parent_id VARCHAR(40) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_140AB62034ECB4E6 FOREIGN KEY (route_id) REFERENCES route (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_140AB620BF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO page (id, route_id, parent_id) SELECT id, route_id, parent_id FROM __temp__page');
$this->addSql('DROP TABLE __temp__page');
$this->addSql('CREATE UNIQUE INDEX UNIQ_140AB62034ECB4E6 ON page (route_id)');
$this->addSql('DROP INDEX IDX_876E0D984A0A3ED');
$this->addSql('CREATE TEMPORARY TABLE __temp__photos AS SELECT id, content_id, thumbnail, title, created_at FROM photos');
$this->addSql('DROP TABLE photos');
$this->addSql('CREATE TABLE photos (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, content_id INTEGER DEFAULT NULL, thumbnail VARCHAR(100) DEFAULT NULL, title VARCHAR(100) DEFAULT NULL, created_at DATETIME DEFAULT NULL, CONSTRAINT FK_876E0D984A0A3ED FOREIGN KEY (content_id) REFERENCES contents (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO photos (id, content_id, thumbnail, title, created_at) SELECT id, content_id, thumbnail, title, created_at FROM __temp__photos');
$this->addSql('DROP TABLE __temp__photos');
$this->addSql('CREATE INDEX IDX_876E0D984A0A3ED ON photos (content_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__project AS SELECT id FROM project');
$this->addSql('DROP TABLE project');
$this->addSql('CREATE TABLE project (id INTEGER NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2FB3D0EEBF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO project (id) SELECT id FROM __temp__project');
$this->addSql('DROP TABLE __temp__project');
$this->addSql('DROP INDEX IDX_7CE748AA76ED395');
$this->addSql('CREATE TEMPORARY TABLE __temp__reset_password_request AS SELECT id, user_id, selector, hashed_token, requested_at, expires_at FROM reset_password_request');
$this->addSql('DROP TABLE reset_password_request');
$this->addSql('CREATE TABLE reset_password_request (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, selector VARCHAR(20) NOT NULL, hashed_token VARCHAR(100) NOT NULL, requested_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, expires_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, CONSTRAINT FK_7CE748AA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO reset_password_request (id, user_id, selector, hashed_token, requested_at, expires_at) SELECT id, user_id, selector, hashed_token, requested_at, expires_at FROM __temp__reset_password_request');
$this->addSql('DROP TABLE __temp__reset_password_request');
$this->addSql('CREATE INDEX IDX_7CE748AA76ED395 ON reset_password_request (user_id)');
$this->addSql('DROP INDEX UNIQ_C7ED653A34ECB4E6');
$this->addSql('DROP INDEX IDX_C7ED653A5550C4ED');
$this->addSql('DROP INDEX IDX_C7ED653A51DDB85F');
$this->addSql('CREATE TEMPORARY TABLE __temp__taxonomy_term AS SELECT id, vid, pid, route_id, name, slug, description, weight, lvl, createdAt, updatedAt, is_enable, thumbnail, path FROM taxonomy_term');
$this->addSql('DROP TABLE taxonomy_term');
$this->addSql('CREATE TABLE taxonomy_term (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, vid INTEGER DEFAULT NULL, pid INTEGER DEFAULT NULL, route_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, weight INTEGER NOT NULL, lvl INTEGER NOT NULL, createdAt DATETIME NOT NULL, updatedAt DATETIME DEFAULT NULL, is_enable BOOLEAN NOT NULL, thumbnail VARCHAR(100) DEFAULT NULL, path CLOB DEFAULT NULL, CONSTRAINT FK_C7ED653A51DDB85F FOREIGN KEY (vid) REFERENCES taxonomy_vocabulary (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C7ED653A5550C4ED FOREIGN KEY (pid) REFERENCES taxonomy_term (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C7ED653A34ECB4E6 FOREIGN KEY (route_id) REFERENCES route (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO taxonomy_term (id, vid, pid, route_id, name, slug, description, weight, lvl, createdAt, updatedAt, is_enable, thumbnail, path) SELECT id, vid, pid, route_id, name, slug, description, weight, lvl, createdAt, updatedAt, is_enable, thumbnail, path FROM __temp__taxonomy_term');
$this->addSql('DROP TABLE __temp__taxonomy_term');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C7ED653A34ECB4E6 ON taxonomy_term (route_id)');
$this->addSql('CREATE INDEX IDX_C7ED653A5550C4ED ON taxonomy_term (pid)');
$this->addSql('CREATE INDEX IDX_C7ED653A51DDB85F ON taxonomy_term (vid)');
$this->addSql('CREATE TEMPORARY TABLE __temp__user_admin AS SELECT id FROM user_admin');
$this->addSql('DROP TABLE user_admin');
$this->addSql('CREATE TABLE user_admin (id INTEGER NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_6ACCF62EBF396750 FOREIGN KEY (id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO user_admin (id) SELECT id FROM __temp__user_admin');
$this->addSql('DROP TABLE __temp__user_admin');
$this->addSql('CREATE TEMPORARY TABLE __temp__user_customer AS SELECT id, is_verified FROM user_customer');
$this->addSql('DROP TABLE user_customer');
$this->addSql('CREATE TABLE user_customer (id INTEGER NOT NULL, is_verified BOOLEAN DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_61B46A09BF396750 FOREIGN KEY (id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO user_customer (id, is_verified) SELECT id, is_verified FROM __temp__user_customer');
$this->addSql('DROP TABLE __temp__user_customer');
$this->addSql('CREATE TEMPORARY TABLE __temp__video AS SELECT id, youtube_video_id FROM video');
$this->addSql('DROP TABLE video');
$this->addSql('CREATE TABLE video (id INTEGER NOT NULL, youtube_video_id VARCHAR(255) NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_7CC7DA2CBF396750 FOREIGN KEY (id) REFERENCES contents (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO video (id, youtube_video_id) SELECT id, youtube_video_id FROM __temp__video');
$this->addSql('DROP TABLE __temp__video');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE vehicle');
$this->addSql('CREATE TEMPORARY TABLE __temp__album AS SELECT id FROM album');
$this->addSql('DROP TABLE album');
$this->addSql('CREATE TABLE album (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)');
$this->addSql('INSERT INTO album (id) SELECT id FROM __temp__album');
$this->addSql('DROP TABLE __temp__album');
$this->addSql('CREATE TEMPORARY TABLE __temp__article AS SELECT id FROM article');
$this->addSql('DROP TABLE article');
$this->addSql('CREATE TABLE article (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)');
$this->addSql('INSERT INTO article (id) SELECT id FROM __temp__article');
$this->addSql('DROP TABLE __temp__article');
$this->addSql('CREATE TEMPORARY TABLE __temp__artist AS SELECT id, genre FROM artist');
$this->addSql('DROP TABLE artist');
$this->addSql('CREATE TABLE artist (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, genre VARCHAR(255) NOT NULL)');
$this->addSql('INSERT INTO artist (id, genre) SELECT id, genre FROM __temp__artist');
$this->addSql('DROP TABLE __temp__artist');
$this->addSql('DROP INDEX IDX_187D3695B7970CF8');
$this->addSql('CREATE TEMPORARY TABLE __temp__audio AS SELECT id, artist_id, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id, price FROM audio');
$this->addSql('DROP TABLE audio');
$this->addSql('CREATE TABLE audio (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, artist_id INTEGER NOT NULL, duration VARCHAR(10) NOT NULL, featured_by VARCHAR(255) DEFAULT NULL, produced_by VARCHAR(255) NOT NULL, distributed_by VARCHAR(255) DEFAULT NULL, primary_file VARCHAR(255) NOT NULL, secondary_file VARCHAR(150) DEFAULT NULL, released_at DATE DEFAULT NULL, purchase_url VARCHAR(255) DEFAULT NULL, resumable_id VARCHAR(100) DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL)');
$this->addSql('INSERT INTO audio (id, artist_id, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id, price) SELECT id, artist_id, duration, featured_by, produced_by, distributed_by, primary_file, secondary_file, released_at, purchase_url, resumable_id, price FROM __temp__audio');
$this->addSql('DROP TABLE __temp__audio');
$this->addSql('CREATE INDEX IDX_187D3695B7970CF8 ON audio (artist_id)');
$this->addSql('DROP INDEX UNIQ_B4FA1177E3C68343');
$this->addSql('DROP INDEX UNIQ_B4FA1177989D9B62');
$this->addSql('DROP INDEX IDX_B4FA1177A76ED395');
$this->addSql('DROP INDEX IDX_B4FA1177E2C35FC');
$this->addSql('CREATE TEMPORARY TABLE __temp__contents AS SELECT id, user_id, term_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, updated_at, position, content_type FROM contents');
$this->addSql('DROP TABLE contents');
$this->addSql('CREATE TABLE contents (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, term_id INTEGER DEFAULT NULL, unique_id VARCHAR(255) DEFAULT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, summary CLOB DEFAULT NULL, body CLOB DEFAULT NULL, thumbnail VARCHAR(255) DEFAULT NULL, status VARCHAR(20) NOT NULL, is_featured BOOLEAN DEFAULT NULL, promoted BOOLEAN DEFAULT NULL, publish_on_socialmedia BOOLEAN DEFAULT NULL, is_published_social_media BOOLEAN DEFAULT NULL, is_home BOOLEAN DEFAULT NULL, date_created DATETIME NOT NULL, date_published DATETIME DEFAULT NULL, meta_keywords VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, updated_at DATETIME DEFAULT NULL, position INTEGER DEFAULT NULL, content_type VARCHAR(255) NOT NULL)');
$this->addSql('INSERT INTO contents (id, user_id, term_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, updated_at, position, content_type) SELECT id, user_id, term_id, unique_id, title, slug, summary, body, thumbnail, status, is_featured, promoted, publish_on_socialmedia, is_published_social_media, is_home, date_created, date_published, meta_keywords, meta_description, updated_at, position, content_type FROM __temp__contents');
$this->addSql('DROP TABLE __temp__contents');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B4FA1177E3C68343 ON contents (unique_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B4FA1177989D9B62 ON contents (slug)');
$this->addSql('CREATE INDEX IDX_B4FA1177A76ED395 ON contents (user_id)');
$this->addSql('CREATE INDEX IDX_B4FA1177E2C35FC ON contents (term_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__document AS SELECT id, file_name, extension FROM document');
$this->addSql('DROP TABLE document');
$this->addSql('CREATE TABLE document (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, file_name VARCHAR(255) DEFAULT NULL, extension VARCHAR(20) DEFAULT NULL)');
$this->addSql('INSERT INTO document (id, file_name, extension) SELECT id, file_name, extension FROM __temp__document');
$this->addSql('DROP TABLE __temp__document');
$this->addSql('CREATE TEMPORARY TABLE __temp__events AS SELECT id, event_date, end_date, event_time, event_venue, country, is_register_require, price FROM events');
$this->addSql('DROP TABLE events');
$this->addSql('CREATE TABLE events (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, event_date DATETIME DEFAULT NULL, end_date DATETIME DEFAULT NULL, event_time VARCHAR(255) DEFAULT NULL, event_venue VARCHAR(255) NOT NULL, country VARCHAR(255) DEFAULT NULL, is_register_require BOOLEAN DEFAULT NULL, price NUMERIC(10, 2) DEFAULT NULL)');
$this->addSql('INSERT INTO events (id, event_date, end_date, event_time, event_venue, country, is_register_require, price) SELECT id, event_date, end_date, event_time, event_venue, country, is_register_require, price FROM __temp__events');
$this->addSql('DROP TABLE __temp__events');
$this->addSql('DROP INDEX IDX_6A2CA10C84A0A3ED');
$this->addSql('CREATE TEMPORARY TABLE __temp__media AS SELECT id, content_id, title, mime_type, file_name, created_at, updated_at FROM media');
$this->addSql('DROP TABLE media');
$this->addSql('CREATE TABLE media (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, content_id INTEGER DEFAULT NULL, title VARCHAR(255) NOT NULL, mime_type VARCHAR(150) NOT NULL, file_name VARCHAR(100) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL)');
$this->addSql('INSERT INTO media (id, content_id, title, mime_type, file_name, created_at, updated_at) SELECT id, content_id, title, mime_type, file_name, created_at, updated_at FROM __temp__media');
$this->addSql('DROP TABLE __temp__media');
$this->addSql('CREATE INDEX IDX_6A2CA10C84A0A3ED ON media (content_id)');
$this->addSql('DROP INDEX IDX_52EA1F098D9F6D38');
$this->addSql('DROP INDEX IDX_52EA1F094584665A');
$this->addSql('CREATE TEMPORARY TABLE __temp__order_item AS SELECT order_id, product_id, price, quantity, license FROM order_item');
$this->addSql('DROP TABLE order_item');
$this->addSql('CREATE TABLE order_item (order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, price NUMERIC(10, 0) DEFAULT NULL, quantity NUMERIC(10, 0) DEFAULT NULL, license VARCHAR(10) DEFAULT NULL, PRIMARY KEY(order_id, product_id))');
$this->addSql('INSERT INTO order_item (order_id, product_id, price, quantity, license) SELECT order_id, product_id, price, quantity, license FROM __temp__order_item');
$this->addSql('DROP TABLE __temp__order_item');
$this->addSql('CREATE INDEX IDX_52EA1F098D9F6D38 ON order_item (order_id)');
$this->addSql('CREATE INDEX IDX_52EA1F094584665A ON order_item (product_id)');
$this->addSql('DROP INDEX UNIQ_140AB62034ECB4E6');
$this->addSql('CREATE TEMPORARY TABLE __temp__page AS SELECT id, route_id, parent_id FROM page');
$this->addSql('DROP TABLE page');
$this->addSql('CREATE TABLE page (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, route_id INTEGER DEFAULT NULL, parent_id VARCHAR(40) DEFAULT NULL)');
$this->addSql('INSERT INTO page (id, route_id, parent_id) SELECT id, route_id, parent_id FROM __temp__page');
$this->addSql('DROP TABLE __temp__page');
$this->addSql('CREATE UNIQUE INDEX UNIQ_140AB62034ECB4E6 ON page (route_id)');
$this->addSql('DROP INDEX IDX_876E0D984A0A3ED');
$this->addSql('CREATE TEMPORARY TABLE __temp__photos AS SELECT id, content_id, title, created_at, thumbnail FROM photos');
$this->addSql('DROP TABLE photos');
$this->addSql('CREATE TABLE photos (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, content_id INTEGER DEFAULT NULL, title VARCHAR(100) DEFAULT NULL, created_at DATETIME DEFAULT NULL, thumbnail VARCHAR(100) DEFAULT NULL)');
$this->addSql('INSERT INTO photos (id, content_id, title, created_at, thumbnail) SELECT id, content_id, title, created_at, thumbnail FROM __temp__photos');
$this->addSql('DROP TABLE __temp__photos');
$this->addSql('CREATE INDEX IDX_876E0D984A0A3ED ON photos (content_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__project AS SELECT id FROM project');
$this->addSql('DROP TABLE project');
$this->addSql('CREATE TABLE project (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)');
$this->addSql('INSERT INTO project (id) SELECT id FROM __temp__project');
$this->addSql('DROP TABLE __temp__project');
$this->addSql('DROP INDEX IDX_7CE748AA76ED395');
$this->addSql('CREATE TEMPORARY TABLE __temp__reset_password_request AS SELECT id, user_id, selector, hashed_token, requested_at, expires_at FROM reset_password_request');
$this->addSql('DROP TABLE reset_password_request');
$this->addSql('CREATE TABLE reset_password_request (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER NOT NULL, selector VARCHAR(20) NOT NULL, hashed_token VARCHAR(100) NOT NULL, requested_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, expires_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
)');
$this->addSql('INSERT INTO reset_password_request (id, user_id, selector, hashed_token, requested_at, expires_at) SELECT id, user_id, selector, hashed_token, requested_at, expires_at FROM __temp__reset_password_request');
$this->addSql('DROP TABLE __temp__reset_password_request');
$this->addSql('CREATE INDEX IDX_7CE748AA76ED395 ON reset_password_request (user_id)');
$this->addSql('DROP INDEX IDX_C7ED653A51DDB85F');
$this->addSql('DROP INDEX IDX_C7ED653A5550C4ED');
$this->addSql('DROP INDEX UNIQ_C7ED653A34ECB4E6');
$this->addSql('CREATE TEMPORARY TABLE __temp__taxonomy_term AS SELECT id, vid, pid, route_id, name, slug, description, weight, path, lvl, createdAt, updatedAt, is_enable, thumbnail FROM taxonomy_term');
$this->addSql('DROP TABLE taxonomy_term');
$this->addSql('CREATE TABLE taxonomy_term (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, vid INTEGER DEFAULT NULL, pid INTEGER DEFAULT NULL, route_id INTEGER DEFAULT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, weight INTEGER NOT NULL, path CLOB DEFAULT NULL, lvl INTEGER NOT NULL, createdAt DATETIME NOT NULL, updatedAt DATETIME DEFAULT NULL, is_enable BOOLEAN NOT NULL, thumbnail VARCHAR(100) DEFAULT NULL)');
$this->addSql('INSERT INTO taxonomy_term (id, vid, pid, route_id, name, slug, description, weight, path, lvl, createdAt, updatedAt, is_enable, thumbnail) SELECT id, vid, pid, route_id, name, slug, description, weight, path, lvl, createdAt, updatedAt, is_enable, thumbnail FROM __temp__taxonomy_term');
$this->addSql('DROP TABLE __temp__taxonomy_term');
$this->addSql('CREATE INDEX IDX_C7ED653A51DDB85F ON taxonomy_term (vid)');
$this->addSql('CREATE INDEX IDX_C7ED653A5550C4ED ON taxonomy_term (pid)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C7ED653A34ECB4E6 ON taxonomy_term (route_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__user_admin AS SELECT id FROM user_admin');
$this->addSql('DROP TABLE user_admin');
$this->addSql('CREATE TABLE user_admin (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)');
$this->addSql('INSERT INTO user_admin (id) SELECT id FROM __temp__user_admin');
$this->addSql('DROP TABLE __temp__user_admin');
$this->addSql('CREATE TEMPORARY TABLE __temp__user_customer AS SELECT id, is_verified FROM user_customer');
$this->addSql('DROP TABLE user_customer');
$this->addSql('CREATE TABLE user_customer (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, is_verified BOOLEAN DEFAULT NULL)');
$this->addSql('INSERT INTO user_customer (id, is_verified) SELECT id, is_verified FROM __temp__user_customer');
$this->addSql('DROP TABLE __temp__user_customer');
$this->addSql('CREATE TEMPORARY TABLE __temp__video AS SELECT id, youtube_video_id FROM video');
$this->addSql('DROP TABLE video');
$this->addSql('CREATE TABLE video (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, youtube_video_id VARCHAR(255) NOT NULL)');
$this->addSql('INSERT INTO video (id, youtube_video_id) SELECT id, youtube_video_id FROM __temp__video');
$this->addSql('DROP TABLE __temp__video');
}
}