* Auto-generated Migration: Please modify to your needs!
12
*/
13
final class Version20200421112353 extends AbstractMigration
14
{
15
public function up(Schema $schema): void
16
{
17
// this up() migration is auto-generated, please modify it to your needs
18
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
19
20
$this->addSql('CREATE TABLE swp_article_previous_relative_url (id SERIAL NOT NULL, article_id INT DEFAULT NULL, relative_url VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
21
$this->addSql('CREATE INDEX IDX_52DAEC0F7294869C ON swp_article_previous_relative_url (article_id)');
22
$this->addSql('ALTER TABLE swp_article_previous_relative_url ADD CONSTRAINT FK_52DAEC0F7294869C FOREIGN KEY (article_id) REFERENCES swp_article (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
23
}
24
25
public function down(Schema $schema): void
26
{
27
// this down() migration is auto-generated, please modify it to your needs
28
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');