<?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 Version20230823064708 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 SCHEMA ogrtabac');
$this->addSql('CREATE SEQUENCE ogresto.codens_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ogresto.dep_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ogresto.restaurant_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ogrtabac.user_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ogresto.user_attributes_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE ogresto.codinsee (id INT NOT NULL, dep VARCHAR(255) DEFAULT NULL, codinsee VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE ogresto.dep (id INT NOT NULL, useridres INT DEFAULT NULL, dep VARCHAR(5) DEFAULT NULL, nom_dep VARCHAR(500) DEFAULT NULL, deplocked BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_CC23B9454713BDFD ON ogresto.dep (useridres)');
$this->addSql('CREATE TABLE ogresto.restaurant_back (id INT NOT NULL, activite VARCHAR(255) DEFAULT NULL, ambiance VARCHAR(255) DEFAULT NULL, budget VARCHAR(255) DEFAULT NULL, cle_adr_complete VARCHAR(255) DEFAULT NULL, cle_adr_pcomp VARCHAR(255) DEFAULT NULL, cle_adr_pcomp2 VARCHAR(255) DEFAULT NULL, cle_comp_ss_num VARCHAR(255) DEFAULT NULL, cle_complete VARCHAR(255) DEFAULT NULL, cle_pcompl VARCHAR(255) DEFAULT NULL, cle_pcompl2 VARCHAR(255) DEFAULT NULL, cle_pcompl2_ss_num VARCHAR(255) DEFAULT NULL, cle_pcompl_ss_num VARCHAR(255) DEFAULT NULL, codens VARCHAR(255) DEFAULT NULL, codinsee VARCHAR(255) DEFAULT NULL, codpost VARCHAR(255) DEFAULT NULL, com_vali VARCHAR(255) DEFAULT NULL, commune VARCHAR(255) DEFAULT NULL, compvoie VARCHAR(255) DEFAULT NULL, couleur_fin VARCHAR(255) DEFAULT NULL, couleur_valid VARCHAR(255) DEFAULT NULL, datecreationetablissement VARCHAR(255) DEFAULT NULL, datedebut VARCHAR(255) DEFAULT NULL, datederniertraitementetablisseme VARCHAR(255) DEFAULT NULL, denomination_f VARCHAR(255) DEFAULT NULL, fonctionalite VARCHAR(255) DEFAULT NULL, fourchette_prix VARCHAR(255) DEFAULT NULL, horaires VARCHAR(255) DEFAULT NULL, id_pj VARCHAR(255) DEFAULT NULL, id_stock VARCHAR(255) DEFAULT NULL, id_ta VARCHAR(255) DEFAULT NULL, nomvoie VARCHAR(255) DEFAULT NULL, note VARCHAR(255) DEFAULT NULL, numvoie VARCHAR(255) DEFAULT NULL, pj VARCHAR(255) DEFAULT NULL, prestation VARCHAR(255) DEFAULT NULL, regime_speciaux VARCHAR(255) DEFAULT NULL, repas VARCHAR(255) DEFAULT NULL, siren VARCHAR(255) DEFAULT NULL, siret VARCHAR(255) DEFAULT NULL, site VARCHAR(255) DEFAULT NULL, stock VARCHAR(255) DEFAULT NULL, ta VARCHAR(255) DEFAULT NULL, tel VARCHAR(255) DEFAULT NULL, telephone VARCHAR(255) DEFAULT NULL, top_ferm_adr_complete VARCHAR(255) DEFAULT NULL, top_ferm_adr_pcomp VARCHAR(255) DEFAULT NULL, top_ferm_adr_pcomp2 VARCHAR(255) DEFAULT NULL, top_ferm_comp_ss_num VARCHAR(255) DEFAULT NULL, top_ferm_complete VARCHAR(255) DEFAULT NULL, top_ferm_pcompl VARCHAR(255) DEFAULT NULL, top_ferm_pcompl2 VARCHAR(255) DEFAULT NULL, top_ferm_pcompl2_ss_num VARCHAR(255) DEFAULT NULL, top_ferm_pcompl_ss_num VARCHAR(255) DEFAULT NULL, type_cuisine VARCHAR(255) DEFAULT NULL, typevoie VARCHAR(255) DEFAULT NULL, villenorm VARCHAR(255) DEFAULT NULL, rappel BOOLEAN DEFAULT NULL, traite BOOLEAN DEFAULT NULL, isfast_food BOOLEAN NOT NULL, isrestaurant BOOLEAN NOT NULL, iscreperie BOOLEAN NOT NULL, isbrasserie BOOLEAN NOT NULL, ispizzeria BOOLEAN NOT NULL, code_saisie VARCHAR(50) DEFAULT NULL, date_de_validation DATE DEFAULT NULL, evenement VARCHAR(50) DEFAULT NULL, date_evenement DATE DEFAULT NULL, doublon BOOLEAN DEFAULT NULL, dep VARCHAR(255) DEFAULT NULL, nom_ok BOOLEAN DEFAULT NULL, adresse_ok BOOLEAN DEFAULT NULL, codens_originals BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE ogresto.restaurant_details_site (id INT NOT NULL, denomination VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, telephone VARCHAR(255) DEFAULT NULL, site_web VARCHAR(255) DEFAULT NULL, codens VARCHAR(255) DEFAULT NULL, id_restaurant INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE ogrtabac."user" (id INT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(5000) DEFAULT NULL, first_name VARCHAR(5000) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8B80920AE7927C74 ON ogrtabac."user" (email)');
$this->addSql('ALTER TABLE ogresto.dep ADD CONSTRAINT FK_CC23B9454713BDFD FOREIGN KEY (useridres) REFERENCES ogrtabac."user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP TABLE codinsee');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SCHEMA scrap');
$this->addSql('ALTER TABLE ogresto.dep DROP CONSTRAINT FK_CC23B9454713BDFD');
$this->addSql('DROP SEQUENCE ogresto.codens_id_seq CASCADE');
$this->addSql('DROP SEQUENCE ogresto.dep_id_seq CASCADE');
$this->addSql('DROP SEQUENCE ogresto.restaurant_id_seq CASCADE');
$this->addSql('DROP SEQUENCE ogrtabac.user_id_seq CASCADE');
$this->addSql('DROP SEQUENCE ogresto.user_attributes_id_seq CASCADE');
$this->addSql('CREATE TABLE codinsee (id SERIAL NOT NULL, dep VARCHAR(255) DEFAULT NULL, codinsee VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('DROP TABLE ogresto.codinsee');
$this->addSql('DROP TABLE ogresto.dep');
$this->addSql('DROP TABLE ogresto.restaurant_back');
$this->addSql('DROP TABLE ogresto.restaurant_details_site');
$this->addSql('DROP TABLE ogrtabac."user"');
}
}