addSql('CREATE SEQUENCE fault_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE intervention_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('ALTER TABLE "user" ADD roles JSON NOT NULL'); $this->addSql('ALTER TABLE "user" ALTER email TYPE VARCHAR(180)'); $this->addSql('ALTER TABLE "user" RENAME COLUMN type TO password'); $this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON "user" (email)'); } 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('DROP SEQUENCE fault_id_seq CASCADE'); $this->addSql('DROP SEQUENCE intervention_id_seq CASCADE'); $this->addSql('DROP SEQUENCE skill_id_seq CASCADE'); $this->addSql('DROP SEQUENCE stock_id_seq CASCADE'); $this->addSql('DROP SEQUENCE user_id_seq CASCADE'); $this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE'); $this->addSql('DROP INDEX UNIQ_IDENTIFIER_EMAIL'); $this->addSql('ALTER TABLE "user" DROP roles'); $this->addSql('ALTER TABLE "user" ALTER email TYPE VARCHAR(255)'); $this->addSql('ALTER TABLE "user" RENAME COLUMN password TO type'); } }