<?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 Version20211015171224 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 system');
$this->addSql('CREATE SCHEMA call');
$this->addSql('CREATE SCHEMA freeswitch');
$this->addSql('CREATE SCHEMA auth');
$this->addSql('CREATE SCHEMA account');
$this->addSql('CREATE SEQUENCE system.attachment_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE call.call_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE call.call_appeal_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE call.call_participant_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE call.call_participant_hold_event_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE call.call_recording_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE freeswitch.callcenter_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE freeswitch.callcenter_agent_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE freeswitch.cdr_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE freeswitch.ivr_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE freeswitch.ivr_action_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE system.offline_reason_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE auth.person_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE account.tenant_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE account.tenant_person_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE account.tenant_person_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE system.tenant_person_status_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE auth.tenant_person_token_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE system.attachment (id INT NOT NULL, tenant_person_id INT DEFAULT NULL, tenant_id INT NOT NULL, original_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, size INT NOT NULL, mime_type VARCHAR(100) 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_F32044B12837A9A ON system.attachment (tenant_person_id)');
$this->addSql('CREATE INDEX IDX_F32044B19033212A ON system.attachment (tenant_id)');
$this->addSql('CREATE TABLE call.call (id INT NOT NULL, from_operator_id INT DEFAULT NULL, to_operator_id INT DEFAULT NULL, ivr_id INT DEFAULT NULL, callback_call_id INT DEFAULT NULL, appeal_type_id INT DEFAULT NULL, tenant_id INT NOT NULL, uuid UUID NOT NULL, direction SMALLINT NOT NULL, status SMALLINT DEFAULT NULL, from_number VARCHAR(100) NOT NULL, to_number VARCHAR(100) NOT NULL, prospect_contact_id INT DEFAULT NULL, started_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, ended_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, answered_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, queue_joined_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, queue_left_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, total_time INT DEFAULT 0 NOT NULL, wait_time INT DEFAULT 0 NOT NULL, talk_time INT DEFAULT 0 NOT NULL, queue_time INT DEFAULT 0 NOT NULL, pre_queue_time INT DEFAULT 0 NOT NULL, hangup_disposition SMALLINT DEFAULT NULL, is_working_time BOOLEAN DEFAULT \'true\' NOT NULL, missed_reason SMALLINT DEFAULT NULL, callback_status SMALLINT DEFAULT NULL, type SMALLINT DEFAULT NULL, prospect_order_id INT DEFAULT NULL, note TEXT 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_3FBD811DC60AA9C6 ON call.call (from_operator_id)');
$this->addSql('CREATE INDEX IDX_3FBD811D76D6A6C0 ON call.call (to_operator_id)');
$this->addSql('CREATE INDEX IDX_3FBD811DB09D9E6B ON call.call (ivr_id)');
$this->addSql('CREATE INDEX IDX_3FBD811DC5812FD7 ON call.call (callback_call_id)');
$this->addSql('CREATE INDEX IDX_3FBD811D2F007FEB ON call.call (appeal_type_id)');
$this->addSql('CREATE INDEX IDX_3FBD811D9033212A ON call.call (tenant_id)');
$this->addSql('CREATE TABLE call.call_appeal_type (id INT NOT NULL, parent_id INT DEFAULT NULL, root_id INT DEFAULT NULL, tenant_id INT NOT NULL, name VARCHAR(255) NOT NULL, depth INT DEFAULT 1 NOT 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_D1F7F3E0727ACA70 ON call.call_appeal_type (parent_id)');
$this->addSql('CREATE INDEX IDX_D1F7F3E079066886 ON call.call_appeal_type (root_id)');
$this->addSql('CREATE INDEX IDX_D1F7F3E09033212A ON call.call_appeal_type (tenant_id)');
$this->addSql('CREATE TABLE call.call_participant (id INT NOT NULL, call_id INT NOT NULL, operator_id INT DEFAULT NULL, tenant_id INT NOT NULL, uuid UUID NOT NULL, prospect_contact_id INT DEFAULT NULL, number VARCHAR(100) NOT NULL, is_initiator BOOLEAN NOT NULL, status SMALLINT DEFAULT NULL, missed_reason SMALLINT DEFAULT NULL, started_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, profile_started_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, progressed_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, media_progressed_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, ring_started_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, answered_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, bridged_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, resurrected_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, last_held_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, ended_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, total_time INT DEFAULT 0 NOT NULL, wait_time INT DEFAULT 0 NOT NULL, progress_wait_time INT DEFAULT 0 NOT NULL, media_progress_wait_time INT DEFAULT 0 NOT NULL, ring_time INT DEFAULT 0 NOT NULL, talk_time INT DEFAULT 0 NOT NULL, billing_time INT DEFAULT 0 NOT NULL, leg_billing_time INT DEFAULT 0 NOT NULL, total_hold_time INT DEFAULT 0 NOT NULL, hangup_disposition SMALLINT NOT NULL, hangup_cause VARCHAR(100) NOT NULL, audio_in_quality_rate SMALLINT DEFAULT NULL, audio_out_quality_rate SMALLINT 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_277AD02850A89B2C ON call.call_participant (call_id)');
$this->addSql('CREATE INDEX IDX_277AD028584598A3 ON call.call_participant (operator_id)');
$this->addSql('CREATE INDEX IDX_277AD0289033212A ON call.call_participant (tenant_id)');
$this->addSql('CREATE TABLE call.call_participant_hold_event (id INT NOT NULL, call_participant_id INT NOT NULL, tenant_id INT NOT NULL, started_at TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL, ended_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT NULL, duration INT 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_CCB2CBBAF463A42A ON call.call_participant_hold_event (call_participant_id)');
$this->addSql('CREATE INDEX IDX_CCB2CBBA9033212A ON call.call_participant_hold_event (tenant_id)');
$this->addSql('CREATE TABLE call.call_recording (id INT NOT NULL, call_id INT NOT NULL, tenant_id INT NOT NULL, original_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, size INT NOT NULL, duration INT NOT NULL, path VARCHAR(255) NOT 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 UNIQUE INDEX UNIQ_466982D750A89B2C ON call.call_recording (call_id)');
$this->addSql('CREATE INDEX IDX_466982D79033212A ON call.call_recording (tenant_id)');
$this->addSql('CREATE TABLE freeswitch.callcenter (id INT NOT NULL, moh_sound_attachment_id INT DEFAULT NULL, tenant_id INT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, strategy VARCHAR(100) NOT NULL, wrap_up_time INT NOT NULL, leg_timeout INT NOT NULL, no_answer_delay_time INT NOT NULL, reject_delay_time INT NOT NULL, ring_progressively_delay_time INT 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 UNIQUE INDEX UNIQ_57307069989D9B62 ON freeswitch.callcenter (slug)');
$this->addSql('CREATE INDEX IDX_573070696E106712 ON freeswitch.callcenter (moh_sound_attachment_id)');
$this->addSql('CREATE INDEX IDX_573070699033212A ON freeswitch.callcenter (tenant_id)');
$this->addSql('CREATE TABLE freeswitch.callcenter_agent (id INT NOT NULL, callcenter_id INT NOT NULL, agent_id INT NOT NULL, tenant_id INT NOT 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_E3420EC82194D7AD ON freeswitch.callcenter_agent (callcenter_id)');
$this->addSql('CREATE INDEX IDX_E3420EC83414710B ON freeswitch.callcenter_agent (agent_id)');
$this->addSql('CREATE INDEX IDX_E3420EC89033212A ON freeswitch.callcenter_agent (tenant_id)');
$this->addSql('CREATE TABLE freeswitch.cdr (id INT NOT NULL, call_id INT NOT NULL, tenant_id INT NOT NULL, json JSON 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_2285D86550A89B2C ON freeswitch.cdr (call_id)');
$this->addSql('CREATE INDEX IDX_2285D8659033212A ON freeswitch.cdr (tenant_id)');
$this->addSql('CREATE TABLE freeswitch.ivr (id INT NOT NULL, greet_long_attachment_id INT NOT NULL, greet_short_attachment_id INT DEFAULT NULL, invalid_sound_attachment_id INT DEFAULT NULL, tenant_id INT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, timeout INT NOT NULL, inter_digit_timeout INT NOT NULL, digit_length INT NOT NULL, max_failures INT NOT NULL, is_active BOOLEAN DEFAULT \'false\' NOT 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 UNIQUE INDEX UNIQ_57E62D60989D9B62 ON freeswitch.ivr (slug)');
$this->addSql('CREATE INDEX IDX_57E62D602E96DAE6 ON freeswitch.ivr (greet_long_attachment_id)');
$this->addSql('CREATE INDEX IDX_57E62D6064075E77 ON freeswitch.ivr (greet_short_attachment_id)');
$this->addSql('CREATE INDEX IDX_57E62D602A1F4492 ON freeswitch.ivr (invalid_sound_attachment_id)');
$this->addSql('CREATE INDEX IDX_57E62D609033212A ON freeswitch.ivr (tenant_id)');
$this->addSql('CREATE TABLE freeswitch.ivr_action (id INT NOT NULL, operator_id INT DEFAULT NULL, callcenter_id INT DEFAULT NULL, ivr_id INT NOT NULL, tenant_id INT NOT NULL, digit VARCHAR(32) NOT NULL, action VARCHAR(32) NOT 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_7F353478584598A3 ON freeswitch.ivr_action (operator_id)');
$this->addSql('CREATE INDEX IDX_7F3534782194D7AD ON freeswitch.ivr_action (callcenter_id)');
$this->addSql('CREATE INDEX IDX_7F353478B09D9E6B ON freeswitch.ivr_action (ivr_id)');
$this->addSql('CREATE INDEX IDX_7F3534789033212A ON freeswitch.ivr_action (tenant_id)');
$this->addSql('CREATE TABLE system.offline_reason (id INT NOT NULL, tenant_id INT NOT NULL, name VARCHAR(255) NOT 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_794625EE9033212A ON system.offline_reason (tenant_id)');
$this->addSql('CREATE TABLE auth.person (id INT NOT NULL, uuid VARCHAR(180) NOT NULL, roles JSON NOT NULL, prospect_person_id INT NOT 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 UNIQUE INDEX UNIQ_5E60AD0BD17F50A6 ON auth.person (uuid)');
$this->addSql('CREATE TABLE account.tenant (id INT NOT NULL, non_working_time_attachment_id INT DEFAULT NULL, prospect_tenant_id INT NOT NULL, subdomain VARCHAR(100) NOT NULL, prospect_work_schedule_id INT 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_2372D18EB019F68E ON account.tenant (non_working_time_attachment_id)');
$this->addSql('CREATE TABLE account.tenant_person (id INT NOT NULL, tenant_id INT NOT NULL, person_id INT DEFAULT NULL, prospect_tenant_person_id INT NOT NULL, number VARCHAR(32) NOT NULL, cidr VARCHAR(64) DEFAULT NULL, password VARCHAR(64) NOT 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_FD31DBAF9033212A ON account.tenant_person (tenant_id)');
$this->addSql('CREATE INDEX IDX_FD31DBAF217BBB47 ON account.tenant_person (person_id)');
$this->addSql('CREATE TABLE account.tenant_person_role (id INT NOT NULL, tenant_person_id INT NOT NULL, tenant_id INT NOT NULL, role SMALLINT NOT 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_8DD5DCF92837A9A ON account.tenant_person_role (tenant_person_id)');
$this->addSql('CREATE INDEX IDX_8DD5DCF99033212A ON account.tenant_person_role (tenant_id)');
$this->addSql('CREATE TABLE system.tenant_person_status (id INT NOT NULL, offline_reason_id INT DEFAULT NULL, tenant_person_id INT NOT NULL, call_id INT DEFAULT NULL, tenant_id INT NOT NULL, status SMALLINT NOT NULL, started_at TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL, ended_at TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT 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_A81AD17E4E9F7733 ON system.tenant_person_status (offline_reason_id)');
$this->addSql('CREATE INDEX IDX_A81AD17E2837A9A ON system.tenant_person_status (tenant_person_id)');
$this->addSql('CREATE INDEX IDX_A81AD17E50A89B2C ON system.tenant_person_status (call_id)');
$this->addSql('CREATE INDEX IDX_A81AD17E9033212A ON system.tenant_person_status (tenant_id)');
$this->addSql('CREATE TABLE auth.tenant_person_token (id INT NOT NULL, tenant_person_id INT NOT NULL, token VARCHAR(255) NOT NULL, expired_at TIMESTAMP(6) WITHOUT TIME ZONE NOT NULL, ip_addr VARCHAR(255) DEFAULT NULL, agent_string VARCHAR(255) DEFAULT NULL, agent_type VARCHAR(255) DEFAULT NULL, agent_name VARCHAR(255) DEFAULT NULL, agent_short_name VARCHAR(255) DEFAULT NULL, agent_version VARCHAR(255) DEFAULT NULL, agent_engine VARCHAR(255) DEFAULT NULL, agent_engine_version VARCHAR(255) DEFAULT NULL, agent_os_name VARCHAR(255) DEFAULT NULL, agent_os_short_name VARCHAR(255) DEFAULT NULL, agent_os_version VARCHAR(255) DEFAULT NULL, agent_os_platform VARCHAR(255) DEFAULT NULL, device_name VARCHAR(255) DEFAULT NULL, device_brand VARCHAR(255) DEFAULT NULL, device_model VARCHAR(255) 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_581B2CEC2837A9A ON auth.tenant_person_token (tenant_person_id)');
$this->addSql('ALTER TABLE system.attachment ADD CONSTRAINT FK_F32044B12837A9A FOREIGN KEY (tenant_person_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.attachment ADD CONSTRAINT FK_F32044B19033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811DC60AA9C6 FOREIGN KEY (from_operator_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811D76D6A6C0 FOREIGN KEY (to_operator_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811DB09D9E6B FOREIGN KEY (ivr_id) REFERENCES freeswitch.ivr (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811DC5812FD7 FOREIGN KEY (callback_call_id) REFERENCES call.call (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811D2F007FEB FOREIGN KEY (appeal_type_id) REFERENCES call.call_appeal_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call ADD CONSTRAINT FK_3FBD811D9033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_appeal_type ADD CONSTRAINT FK_D1F7F3E0727ACA70 FOREIGN KEY (parent_id) REFERENCES call.call_appeal_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_appeal_type ADD CONSTRAINT FK_D1F7F3E079066886 FOREIGN KEY (root_id) REFERENCES call.call_appeal_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_appeal_type ADD CONSTRAINT FK_D1F7F3E09033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_participant ADD CONSTRAINT FK_277AD02850A89B2C FOREIGN KEY (call_id) REFERENCES call.call (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_participant ADD CONSTRAINT FK_277AD028584598A3 FOREIGN KEY (operator_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_participant ADD CONSTRAINT FK_277AD0289033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_participant_hold_event ADD CONSTRAINT FK_CCB2CBBAF463A42A FOREIGN KEY (call_participant_id) REFERENCES call.call_participant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_participant_hold_event ADD CONSTRAINT FK_CCB2CBBA9033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_recording ADD CONSTRAINT FK_466982D750A89B2C FOREIGN KEY (call_id) REFERENCES call.call (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE call.call_recording ADD CONSTRAINT FK_466982D79033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.callcenter ADD CONSTRAINT FK_573070696E106712 FOREIGN KEY (moh_sound_attachment_id) REFERENCES system.attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.callcenter ADD CONSTRAINT FK_573070699033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent ADD CONSTRAINT FK_E3420EC82194D7AD FOREIGN KEY (callcenter_id) REFERENCES freeswitch.callcenter (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent ADD CONSTRAINT FK_E3420EC83414710B FOREIGN KEY (agent_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent ADD CONSTRAINT FK_E3420EC89033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.cdr ADD CONSTRAINT FK_2285D86550A89B2C FOREIGN KEY (call_id) REFERENCES call.call (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.cdr ADD CONSTRAINT FK_2285D8659033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr ADD CONSTRAINT FK_57E62D602E96DAE6 FOREIGN KEY (greet_long_attachment_id) REFERENCES system.attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr ADD CONSTRAINT FK_57E62D6064075E77 FOREIGN KEY (greet_short_attachment_id) REFERENCES system.attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr ADD CONSTRAINT FK_57E62D602A1F4492 FOREIGN KEY (invalid_sound_attachment_id) REFERENCES system.attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr ADD CONSTRAINT FK_57E62D609033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr_action ADD CONSTRAINT FK_7F353478584598A3 FOREIGN KEY (operator_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr_action ADD CONSTRAINT FK_7F3534782194D7AD FOREIGN KEY (callcenter_id) REFERENCES freeswitch.callcenter (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr_action ADD CONSTRAINT FK_7F353478B09D9E6B FOREIGN KEY (ivr_id) REFERENCES freeswitch.ivr (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE freeswitch.ivr_action ADD CONSTRAINT FK_7F3534789033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.offline_reason ADD CONSTRAINT FK_794625EE9033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE account.tenant ADD CONSTRAINT FK_2372D18EB019F68E FOREIGN KEY (non_working_time_attachment_id) REFERENCES system.attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE account.tenant_person ADD CONSTRAINT FK_FD31DBAF9033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE account.tenant_person ADD CONSTRAINT FK_FD31DBAF217BBB47 FOREIGN KEY (person_id) REFERENCES auth.person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE account.tenant_person_role ADD CONSTRAINT FK_8DD5DCF92837A9A FOREIGN KEY (tenant_person_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE account.tenant_person_role ADD CONSTRAINT FK_8DD5DCF99033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.tenant_person_status ADD CONSTRAINT FK_A81AD17E4E9F7733 FOREIGN KEY (offline_reason_id) REFERENCES system.offline_reason (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.tenant_person_status ADD CONSTRAINT FK_A81AD17E2837A9A FOREIGN KEY (tenant_person_id) REFERENCES account.tenant_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.tenant_person_status ADD CONSTRAINT FK_A81AD17E50A89B2C FOREIGN KEY (call_id) REFERENCES call.call (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE system.tenant_person_status ADD CONSTRAINT FK_A81AD17E9033212A FOREIGN KEY (tenant_id) REFERENCES account.tenant (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE auth.tenant_person_token ADD CONSTRAINT FK_581B2CEC2837A9A FOREIGN KEY (tenant_person_id) REFERENCES account.tenant_person (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('ALTER TABLE freeswitch.callcenter DROP CONSTRAINT FK_573070696E106712');
$this->addSql('ALTER TABLE freeswitch.ivr DROP CONSTRAINT FK_57E62D602E96DAE6');
$this->addSql('ALTER TABLE freeswitch.ivr DROP CONSTRAINT FK_57E62D6064075E77');
$this->addSql('ALTER TABLE freeswitch.ivr DROP CONSTRAINT FK_57E62D602A1F4492');
$this->addSql('ALTER TABLE account.tenant DROP CONSTRAINT FK_2372D18EB019F68E');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811DC5812FD7');
$this->addSql('ALTER TABLE call.call_participant DROP CONSTRAINT FK_277AD02850A89B2C');
$this->addSql('ALTER TABLE call.call_recording DROP CONSTRAINT FK_466982D750A89B2C');
$this->addSql('ALTER TABLE freeswitch.cdr DROP CONSTRAINT FK_2285D86550A89B2C');
$this->addSql('ALTER TABLE system.tenant_person_status DROP CONSTRAINT FK_A81AD17E50A89B2C');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811D2F007FEB');
$this->addSql('ALTER TABLE call.call_appeal_type DROP CONSTRAINT FK_D1F7F3E0727ACA70');
$this->addSql('ALTER TABLE call.call_appeal_type DROP CONSTRAINT FK_D1F7F3E079066886');
$this->addSql('ALTER TABLE call.call_participant_hold_event DROP CONSTRAINT FK_CCB2CBBAF463A42A');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent DROP CONSTRAINT FK_E3420EC82194D7AD');
$this->addSql('ALTER TABLE freeswitch.ivr_action DROP CONSTRAINT FK_7F3534782194D7AD');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811DB09D9E6B');
$this->addSql('ALTER TABLE freeswitch.ivr_action DROP CONSTRAINT FK_7F353478B09D9E6B');
$this->addSql('ALTER TABLE system.tenant_person_status DROP CONSTRAINT FK_A81AD17E4E9F7733');
$this->addSql('ALTER TABLE account.tenant_person DROP CONSTRAINT FK_FD31DBAF217BBB47');
$this->addSql('ALTER TABLE system.attachment DROP CONSTRAINT FK_F32044B19033212A');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811D9033212A');
$this->addSql('ALTER TABLE call.call_appeal_type DROP CONSTRAINT FK_D1F7F3E09033212A');
$this->addSql('ALTER TABLE call.call_participant DROP CONSTRAINT FK_277AD0289033212A');
$this->addSql('ALTER TABLE call.call_participant_hold_event DROP CONSTRAINT FK_CCB2CBBA9033212A');
$this->addSql('ALTER TABLE call.call_recording DROP CONSTRAINT FK_466982D79033212A');
$this->addSql('ALTER TABLE freeswitch.callcenter DROP CONSTRAINT FK_573070699033212A');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent DROP CONSTRAINT FK_E3420EC89033212A');
$this->addSql('ALTER TABLE freeswitch.cdr DROP CONSTRAINT FK_2285D8659033212A');
$this->addSql('ALTER TABLE freeswitch.ivr DROP CONSTRAINT FK_57E62D609033212A');
$this->addSql('ALTER TABLE freeswitch.ivr_action DROP CONSTRAINT FK_7F3534789033212A');
$this->addSql('ALTER TABLE system.offline_reason DROP CONSTRAINT FK_794625EE9033212A');
$this->addSql('ALTER TABLE account.tenant_person DROP CONSTRAINT FK_FD31DBAF9033212A');
$this->addSql('ALTER TABLE account.tenant_person_role DROP CONSTRAINT FK_8DD5DCF99033212A');
$this->addSql('ALTER TABLE system.tenant_person_status DROP CONSTRAINT FK_A81AD17E9033212A');
$this->addSql('ALTER TABLE system.attachment DROP CONSTRAINT FK_F32044B12837A9A');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811DC60AA9C6');
$this->addSql('ALTER TABLE call.call DROP CONSTRAINT FK_3FBD811D76D6A6C0');
$this->addSql('ALTER TABLE call.call_participant DROP CONSTRAINT FK_277AD028584598A3');
$this->addSql('ALTER TABLE freeswitch.callcenter_agent DROP CONSTRAINT FK_E3420EC83414710B');
$this->addSql('ALTER TABLE freeswitch.ivr_action DROP CONSTRAINT FK_7F353478584598A3');
$this->addSql('ALTER TABLE account.tenant_person_role DROP CONSTRAINT FK_8DD5DCF92837A9A');
$this->addSql('ALTER TABLE system.tenant_person_status DROP CONSTRAINT FK_A81AD17E2837A9A');
$this->addSql('ALTER TABLE auth.tenant_person_token DROP CONSTRAINT FK_581B2CEC2837A9A');
$this->addSql('DROP SEQUENCE system.attachment_id_seq CASCADE');
$this->addSql('DROP SEQUENCE call.call_id_seq CASCADE');
$this->addSql('DROP SEQUENCE call.call_appeal_type_id_seq CASCADE');
$this->addSql('DROP SEQUENCE call.call_participant_id_seq CASCADE');
$this->addSql('DROP SEQUENCE call.call_participant_hold_event_id_seq CASCADE');
$this->addSql('DROP SEQUENCE call.call_recording_id_seq CASCADE');
$this->addSql('DROP SEQUENCE freeswitch.callcenter_id_seq CASCADE');
$this->addSql('DROP SEQUENCE freeswitch.callcenter_agent_id_seq CASCADE');
$this->addSql('DROP SEQUENCE freeswitch.cdr_id_seq CASCADE');
$this->addSql('DROP SEQUENCE freeswitch.ivr_id_seq CASCADE');
$this->addSql('DROP SEQUENCE freeswitch.ivr_action_id_seq CASCADE');
$this->addSql('DROP SEQUENCE system.offline_reason_id_seq CASCADE');
$this->addSql('DROP SEQUENCE auth.person_id_seq CASCADE');
$this->addSql('DROP SEQUENCE account.tenant_id_seq CASCADE');
$this->addSql('DROP SEQUENCE account.tenant_person_id_seq CASCADE');
$this->addSql('DROP SEQUENCE account.tenant_person_role_id_seq CASCADE');
$this->addSql('DROP SEQUENCE system.tenant_person_status_id_seq CASCADE');
$this->addSql('DROP SEQUENCE auth.tenant_person_token_id_seq CASCADE');
$this->addSql('DROP TABLE system.attachment');
$this->addSql('DROP TABLE call.call');
$this->addSql('DROP TABLE call.call_appeal_type');
$this->addSql('DROP TABLE call.call_participant');
$this->addSql('DROP TABLE call.call_participant_hold_event');
$this->addSql('DROP TABLE call.call_recording');
$this->addSql('DROP TABLE freeswitch.callcenter');
$this->addSql('DROP TABLE freeswitch.callcenter_agent');
$this->addSql('DROP TABLE freeswitch.cdr');
$this->addSql('DROP TABLE freeswitch.ivr');
$this->addSql('DROP TABLE freeswitch.ivr_action');
$this->addSql('DROP TABLE system.offline_reason');
$this->addSql('DROP TABLE auth.person');
$this->addSql('DROP TABLE account.tenant');
$this->addSql('DROP TABLE account.tenant_person');
$this->addSql('DROP TABLE account.tenant_person_role');
$this->addSql('DROP TABLE system.tenant_person_status');
$this->addSql('DROP TABLE auth.tenant_person_token');
}
}