addSql(<<<'SQL' CREATE TABLE subscriptions (id SERIAL NOT NULL, users_id INT NOT NULL, PRIMARY KEY(id)) SQL); $this->addSql(<<<'SQL' CREATE INDEX IDX_4778A0167B3B43D ON subscriptions (users_id) SQL); $this->addSql(<<<'SQL' ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A0167B3B43D FOREIGN KEY (users_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE SQL); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql(<<<'SQL' CREATE SCHEMA public SQL); $this->addSql(<<<'SQL' ALTER TABLE subscriptions DROP CONSTRAINT FK_4778A0167B3B43D SQL); $this->addSql(<<<'SQL' DROP TABLE subscriptions SQL); } }