<?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 Version20220127112149 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 omni');
$this->addSql('CREATE SEQUENCE omni.channel_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE omni.channel (id INT NOT NULL, tenant_id INT NOT NULL, type VARCHAR(100) NOT NULL, facebook_access_token TEXT DEFAULT NULL, facebook_data_access_expiration_time INT DEFAULT NULL, facebook_granted_scopes VARCHAR(255) DEFAULT NULL, facebook_user_id BIGINT DEFAULT NULL, created_at TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL, is_deleted BOOLEAN DEFAULT \'false\' NOT NULL, deleted_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_56D4CC489033212A ON omni.channel (tenant_id)');
$this->addSql('ALTER TABLE omni.channel ADD CONSTRAINT FK_56D4CC489033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
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 omni.channel_id_seq CASCADE');
$this->addSql('DROP TABLE omni.channel');
}
}