<?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 Version20230811110913 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 SEQUENCE cities_id_seq INCREMENT BY 1 MINVALUE 50 START 50');
$this->addSql('CREATE SEQUENCE city_reporting_period_id_seq INCREMENT BY 1 MINVALUE 50000 START 50000');
$this->addSql('CREATE SEQUENCE currency_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE exchange_rate_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE income_operators_id_seq INCREMENT BY 1 MINVALUE 400 START 400');
$this->addSql('CREATE SEQUENCE incomes_id_sequence INCREMENT BY 1 MINVALUE 2000 START 2000');
$this->addSql('CREATE SEQUENCE payment_percent_id_seq INCREMENT BY 1 MINVALUE 50 START 50');
$this->addSql('CREATE SEQUENCE refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE reporting_periods_id_seq INCREMENT BY 1 MINVALUE 1120 START 1120');
$this->addSql('CREATE SEQUENCE resources_id_seq INCREMENT BY 1 MINVALUE 30 START 30');
$this->addSql('CREATE SEQUENCE resources_reporting_period_id_seq INCREMENT BY 1 MINVALUE 20000 START 20000');
$this->addSql('CREATE SEQUENCE telegram_message_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE transactions_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE user_access_id_seq INCREMENT BY 1 MINVALUE 50 START 50');
$this->addSql('CREATE SEQUENCE user_access_groups_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE user_payment_percentages_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE user_telegram_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 8 START 8');
$this->addSql('CREATE SEQUENCE wage_bonus_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE wage_fine_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE wages_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE workshift_form_result_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE cities (id INT NOT NULL, ins_group_id INT NOT NULL, short_name VARCHAR(255) DEFAULT \'\' NOT NULL, code VARCHAR(255) DEFAULT \'\' NOT NULL, is_model BOOLEAN DEFAULT false NOT NULL, is_operator BOOLEAN DEFAULT false NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D95DB16BE76F9BDA ON cities (ins_group_id)');
$this->addSql('CREATE TABLE city_reporting_period (id INT NOT NULL, reporting_period_id INT NOT NULL, city_id INT NOT NULL, amount_income NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, amount_operators_models INT DEFAULT 0 NOT NULL, amount_operators_wages INT DEFAULT 0 NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C50C8BE2832EB1C ON city_reporting_period (reporting_period_id)');
$this->addSql('CREATE INDEX IDX_C50C8BE8BAC62AF ON city_reporting_period (city_id)');
$this->addSql('CREATE TABLE currency (id INT NOT NULL, short_name VARCHAR(255) DEFAULT \'\' NOT NULL, ins_country_id INT NOT NULL, full_name VARCHAR(255) DEFAULT \'\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE exchange_rate (id INT NOT NULL, from_id INT NOT NULL, to_id INT NOT NULL, reporting_period_id INT NOT NULL, rate NUMERIC(10, 2) DEFAULT \'0\' NOT NULL, custom_rate NUMERIC(10, 2) DEFAULT \'0\' NOT NULL, created_at DATE DEFAULT \'2022-12-24 11:04:47\' NOT NULL, updated_at DATE DEFAULT \'2022-12-24 11:04:47\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_E9521FAB78CED90B ON exchange_rate (from_id)');
$this->addSql('CREATE INDEX IDX_E9521FAB30354A65 ON exchange_rate (to_id)');
$this->addSql('CREATE INDEX IDX_E9521FAB2832EB1C ON exchange_rate (reporting_period_id)');
$this->addSql('CREATE TABLE income_operators (id INT NOT NULL, income_id INT NOT NULL, city_id INT DEFAULT NULL, ins_operator_id INT NOT NULL, ins_workshift_id INT NOT NULL, usd_total NUMERIC(50, 2) DEFAULT NULL, import_usd_total NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, is_main BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C6FD74EE640ED2C0 ON income_operators (income_id)');
$this->addSql('CREATE INDEX IDX_C6FD74EE8BAC62AF ON income_operators (city_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C6FD74EE640ED2C0DECA77BA7E1EC27E ON income_operators (income_id, ins_operator_id, ins_workshift_id)');
$this->addSql('CREATE TABLE income_operator_wage (income_operator_id INT NOT NULL, wage_id INT NOT NULL, PRIMARY KEY(income_operator_id, wage_id))');
$this->addSql('CREATE INDEX IDX_3BA1426E19FB756E ON income_operator_wage (income_operator_id)');
$this->addSql('CREATE INDEX IDX_3BA1426EC9E15D6A ON income_operator_wage (wage_id)');
$this->addSql('CREATE TABLE incomes (id INT NOT NULL, resource_reporting_period_id INT NOT NULL, group_reporting_period_id INT DEFAULT NULL, ins_account_id INT DEFAULT 0 NOT NULL, nickname VARCHAR(255) DEFAULT \'\' NOT NULL, screen_name VARCHAR(255) DEFAULT \'\' NOT NULL, workshift_id INT DEFAULT NULL, relation_work_shift BOOLEAN NOT NULL, ins_model_id INT DEFAULT 0 NOT NULL, value NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, usd_value NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, external_value NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, external_usd_value NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, custom_external_usd_value NUMERIC(50, 2) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, status VARCHAR(255) DEFAULT \'completed\' NOT NULL, cancel_reason VARCHAR(255) DEFAULT \'\' NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, start_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, end_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, planning_start_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, planning_end_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, unknown_model BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_9DE2B5BD42E084DE ON incomes (resource_reporting_period_id)');
$this->addSql('CREATE INDEX IDX_9DE2B5BDF01071FE ON incomes (group_reporting_period_id)');
$this->addSql('CREATE TABLE income_wage (income_id INT NOT NULL, wage_id INT NOT NULL, PRIMARY KEY(income_id, wage_id))');
$this->addSql('CREATE INDEX IDX_439798B7640ED2C0 ON income_wage (income_id)');
$this->addSql('CREATE INDEX IDX_439798B7C9E15D6A ON income_wage (wage_id)');
$this->addSql('CREATE TABLE payment_percent (id INT NOT NULL, reporting_period_id INT NOT NULL, ins_user_id INT NOT NULL, related_ins_user_id INT DEFAULT 0 NOT NULL, type VARCHAR(255) NOT NULL, payment_percent INT NOT NULL, custom_payment_percent INT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_78FF8ED32832EB1C ON payment_percent (reporting_period_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_78FF8ED32832EB1CF01A3F033BF14187 ON payment_percent (reporting_period_id, ins_user_id, related_ins_user_id)');
$this->addSql('CREATE TABLE refresh_tokens (id INT NOT NULL, refresh_token VARCHAR(128) NOT NULL, username VARCHAR(255) NOT NULL, valid TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_9BACE7E1C74F2195 ON refresh_tokens (refresh_token)');
$this->addSql('CREATE TABLE reporting_periods (id INT NOT NULL, start_dt DATE NOT NULL, end_dt DATE NOT NULL, status INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B146BB0ACA2497B24AA4E439 ON reporting_periods (start_dt, end_dt)');
$this->addSql('CREATE TABLE resources (id INT NOT NULL, ins_resource_id INT NOT NULL, short_name VARCHAR(255) DEFAULT \'\' NOT NULL, ratio NUMERIC(10, 2) DEFAULT \'0\' NOT NULL, index INT NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_EF66EBAEFBD723C80736701 ON resources (ins_resource_id, index)');
$this->addSql('CREATE TABLE resources_reporting_period (id INT NOT NULL, reporting_period_id INT NOT NULL, resource_id INT NOT NULL, amount NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, ratio NUMERIC(10, 2) DEFAULT \'0\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_386B24BC2832EB1C ON resources_reporting_period (reporting_period_id)');
$this->addSql('CREATE INDEX IDX_386B24BC89329D25 ON resources_reporting_period (resource_id)');
$this->addSql('CREATE TABLE rights (id INT NOT NULL, parent_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, code VARCHAR(255) DEFAULT NULL, right_type INT NOT NULL, exclusion_group VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_160D10377153098 ON rights (code)');
$this->addSql('CREATE INDEX IDX_160D103727ACA70 ON rights (parent_id)');
$this->addSql('CREATE TABLE telegram_message (id INT NOT NULL, transaction_id INT DEFAULT NULL, ins_user_id INT NOT NULL, message TEXT NOT NULL, status VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, action VARCHAR(255) NOT NULL, message_id INT DEFAULT NULL, answer VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EDFB51892FC0CB0F ON telegram_message (transaction_id)');
$this->addSql('CREATE TABLE transactions (id INT NOT NULL, wage_id INT DEFAULT NULL, reporting_period_id INT NOT NULL, ins_user_id INT NOT NULL, value NUMERIC(50, 2) DEFAULT \'0\' NOT NULL, transaction_id VARCHAR(255) NOT NULL, paid BOOLEAN NOT NULL, convenient_receive_now BOOLEAN DEFAULT NULL, convenient_received_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, have_received BOOLEAN DEFAULT NULL, have_received_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EAA81A4CC9E15D6A ON transactions (wage_id)');
$this->addSql('CREATE INDEX IDX_EAA81A4C2832EB1C ON transactions (reporting_period_id)');
$this->addSql('CREATE TABLE user_access (id INT NOT NULL, ins_user_id INT NOT NULL, pin VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_633B3069F01A3F03 ON user_access (ins_user_id)');
$this->addSql('CREATE TABLE user_access_rights (user_access_id INT NOT NULL, right_id INT NOT NULL, PRIMARY KEY(user_access_id, right_id))');
$this->addSql('CREATE INDEX IDX_1D65E9614F0AEA2B ON user_access_rights (user_access_id)');
$this->addSql('CREATE INDEX IDX_1D65E96154976835 ON user_access_rights (right_id)');
$this->addSql('CREATE TABLE user_access_groups (id INT NOT NULL, user_access_id INT NOT NULL, ins_group_id INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EC6801124F0AEA2B ON user_access_groups (user_access_id)');
$this->addSql('CREATE TABLE user_payment_percentages (id INT NOT NULL, ins_user_id INT NOT NULL, percentages JSON NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE user_telegram (id INT NOT NULL, ins_user_id INT NOT NULL, telegram_id VARCHAR(255) NOT NULL, telegram_user_name VARCHAR(255) DEFAULT NULL, type VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE users (id INT NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, surname VARCHAR(255) NOT NULL, two_fa_key VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1483A5E9E7927C74 ON users (email)');
$this->addSql('CREATE TABLE wage_bonus (id INT NOT NULL, wage_id INT NOT NULL, nickname VARCHAR(255) DEFAULT \'\' NOT NULL, related_model_id INT DEFAULT NULL, reason VARCHAR(255) DEFAULT \'\' NOT NULL, value NUMERIC(50, 2) NOT NULL, comment VARCHAR(255) DEFAULT \'\' NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_1BC59BD5C9E15D6A ON wage_bonus (wage_id)');
$this->addSql('CREATE TABLE wage_fine (id INT NOT NULL, wage_id INT NOT NULL, nickname VARCHAR(255) DEFAULT \'\' NOT NULL, related_model_id INT DEFAULT NULL, reason VARCHAR(255) DEFAULT \'\' NOT NULL, value NUMERIC(50, 2) NOT NULL, comment VARCHAR(255) DEFAULT \'\' NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_5D0C2581C9E15D6A ON wage_fine (wage_id)');
$this->addSql('CREATE TABLE wages (id INT NOT NULL, reporting_period_id INT NOT NULL, ins_user_id INT NOT NULL, ins_user_role VARCHAR(255) NOT NULL, share NUMERIC(10, 2) DEFAULT \'0\' NOT NULL, status VARCHAR(255) NOT NULL, total NUMERIC(50, 2) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_925439652832EB1C ON wages (reporting_period_id)');
$this->addSql('CREATE TABLE workshift_form_result (id INT NOT NULL, user_id INT NOT NULL, workshift_id INT DEFAULT NULL, income_id INT DEFAULT NULL, status VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, reminded_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, hash VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('ALTER TABLE city_reporting_period ADD CONSTRAINT FK_C50C8BE2832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE city_reporting_period ADD CONSTRAINT FK_C50C8BE8BAC62AF FOREIGN KEY (city_id) REFERENCES cities (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE exchange_rate ADD CONSTRAINT FK_E9521FAB78CED90B FOREIGN KEY (from_id) REFERENCES currency (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE exchange_rate ADD CONSTRAINT FK_E9521FAB30354A65 FOREIGN KEY (to_id) REFERENCES currency (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE exchange_rate ADD CONSTRAINT FK_E9521FAB2832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_operators ADD CONSTRAINT FK_C6FD74EE640ED2C0 FOREIGN KEY (income_id) REFERENCES incomes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_operators ADD CONSTRAINT FK_C6FD74EE8BAC62AF FOREIGN KEY (city_id) REFERENCES cities (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_operator_wage ADD CONSTRAINT FK_3BA1426E19FB756E FOREIGN KEY (income_operator_id) REFERENCES income_operators (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_operator_wage ADD CONSTRAINT FK_3BA1426EC9E15D6A FOREIGN KEY (wage_id) REFERENCES wages (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE incomes ADD CONSTRAINT FK_9DE2B5BD42E084DE FOREIGN KEY (resource_reporting_period_id) REFERENCES resources_reporting_period (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE incomes ADD CONSTRAINT FK_9DE2B5BDF01071FE FOREIGN KEY (group_reporting_period_id) REFERENCES city_reporting_period (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_wage ADD CONSTRAINT FK_439798B7640ED2C0 FOREIGN KEY (income_id) REFERENCES incomes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE income_wage ADD CONSTRAINT FK_439798B7C9E15D6A FOREIGN KEY (wage_id) REFERENCES wages (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE payment_percent ADD CONSTRAINT FK_78FF8ED32832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE resources_reporting_period ADD CONSTRAINT FK_386B24BC2832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE resources_reporting_period ADD CONSTRAINT FK_386B24BC89329D25 FOREIGN KEY (resource_id) REFERENCES resources (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE rights ADD CONSTRAINT FK_160D103727ACA70 FOREIGN KEY (parent_id) REFERENCES rights (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE telegram_message ADD CONSTRAINT FK_EDFB51892FC0CB0F FOREIGN KEY (transaction_id) REFERENCES transactions (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE transactions ADD CONSTRAINT FK_EAA81A4CC9E15D6A FOREIGN KEY (wage_id) REFERENCES wages (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE transactions ADD CONSTRAINT FK_EAA81A4C2832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE user_access_rights ADD CONSTRAINT FK_1D65E9614F0AEA2B FOREIGN KEY (user_access_id) REFERENCES user_access (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE user_access_rights ADD CONSTRAINT FK_1D65E96154976835 FOREIGN KEY (right_id) REFERENCES rights (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE user_access_groups ADD CONSTRAINT FK_EC6801124F0AEA2B FOREIGN KEY (user_access_id) REFERENCES user_access (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE wage_bonus ADD CONSTRAINT FK_1BC59BD5C9E15D6A FOREIGN KEY (wage_id) REFERENCES wages (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE wage_fine ADD CONSTRAINT FK_5D0C2581C9E15D6A FOREIGN KEY (wage_id) REFERENCES wages (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE wages ADD CONSTRAINT FK_925439652832EB1C FOREIGN KEY (reporting_period_id) REFERENCES reporting_periods (id) ON DELETE CASCADE 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 city_reporting_period DROP CONSTRAINT FK_C50C8BE8BAC62AF');
$this->addSql('ALTER TABLE income_operators DROP CONSTRAINT FK_C6FD74EE8BAC62AF');
$this->addSql('ALTER TABLE incomes DROP CONSTRAINT FK_9DE2B5BDF01071FE');
$this->addSql('ALTER TABLE exchange_rate DROP CONSTRAINT FK_E9521FAB78CED90B');
$this->addSql('ALTER TABLE exchange_rate DROP CONSTRAINT FK_E9521FAB30354A65');
$this->addSql('ALTER TABLE income_operator_wage DROP CONSTRAINT FK_3BA1426E19FB756E');
$this->addSql('ALTER TABLE income_operators DROP CONSTRAINT FK_C6FD74EE640ED2C0');
$this->addSql('ALTER TABLE income_wage DROP CONSTRAINT FK_439798B7640ED2C0');
$this->addSql('ALTER TABLE city_reporting_period DROP CONSTRAINT FK_C50C8BE2832EB1C');
$this->addSql('ALTER TABLE exchange_rate DROP CONSTRAINT FK_E9521FAB2832EB1C');
$this->addSql('ALTER TABLE payment_percent DROP CONSTRAINT FK_78FF8ED32832EB1C');
$this->addSql('ALTER TABLE resources_reporting_period DROP CONSTRAINT FK_386B24BC2832EB1C');
$this->addSql('ALTER TABLE transactions DROP CONSTRAINT FK_EAA81A4C2832EB1C');
$this->addSql('ALTER TABLE wages DROP CONSTRAINT FK_925439652832EB1C');
$this->addSql('ALTER TABLE resources_reporting_period DROP CONSTRAINT FK_386B24BC89329D25');
$this->addSql('ALTER TABLE incomes DROP CONSTRAINT FK_9DE2B5BD42E084DE');
$this->addSql('ALTER TABLE rights DROP CONSTRAINT FK_160D103727ACA70');
$this->addSql('ALTER TABLE user_access_rights DROP CONSTRAINT FK_1D65E96154976835');
$this->addSql('ALTER TABLE telegram_message DROP CONSTRAINT FK_EDFB51892FC0CB0F');
$this->addSql('ALTER TABLE user_access_rights DROP CONSTRAINT FK_1D65E9614F0AEA2B');
$this->addSql('ALTER TABLE user_access_groups DROP CONSTRAINT FK_EC6801124F0AEA2B');
$this->addSql('ALTER TABLE income_operator_wage DROP CONSTRAINT FK_3BA1426EC9E15D6A');
$this->addSql('ALTER TABLE income_wage DROP CONSTRAINT FK_439798B7C9E15D6A');
$this->addSql('ALTER TABLE transactions DROP CONSTRAINT FK_EAA81A4CC9E15D6A');
$this->addSql('ALTER TABLE wage_bonus DROP CONSTRAINT FK_1BC59BD5C9E15D6A');
$this->addSql('ALTER TABLE wage_fine DROP CONSTRAINT FK_5D0C2581C9E15D6A');
$this->addSql('DROP SEQUENCE cities_id_seq CASCADE');
$this->addSql('DROP SEQUENCE city_reporting_period_id_seq CASCADE');
$this->addSql('DROP SEQUENCE currency_id_seq CASCADE');
$this->addSql('DROP SEQUENCE exchange_rate_id_seq CASCADE');
$this->addSql('DROP SEQUENCE income_operators_id_seq CASCADE');
$this->addSql('DROP SEQUENCE incomes_id_sequence CASCADE');
$this->addSql('DROP SEQUENCE payment_percent_id_seq CASCADE');
$this->addSql('DROP SEQUENCE refresh_tokens_id_seq CASCADE');
$this->addSql('DROP SEQUENCE reporting_periods_id_seq CASCADE');
$this->addSql('DROP SEQUENCE resources_id_seq CASCADE');
$this->addSql('DROP SEQUENCE resources_reporting_period_id_seq CASCADE');
$this->addSql('DROP SEQUENCE telegram_message_id_seq CASCADE');
$this->addSql('DROP SEQUENCE transactions_id_seq CASCADE');
$this->addSql('DROP SEQUENCE user_access_id_seq CASCADE');
$this->addSql('DROP SEQUENCE user_access_groups_id_seq CASCADE');
$this->addSql('DROP SEQUENCE user_payment_percentages_id_seq CASCADE');
$this->addSql('DROP SEQUENCE user_telegram_id_seq CASCADE');
$this->addSql('DROP SEQUENCE users_id_seq CASCADE');
$this->addSql('DROP SEQUENCE wage_bonus_id_seq CASCADE');
$this->addSql('DROP SEQUENCE wage_fine_id_seq CASCADE');
$this->addSql('DROP SEQUENCE wages_id_seq CASCADE');
$this->addSql('DROP SEQUENCE workshift_form_result_id_seq CASCADE');
$this->addSql('DROP TABLE cities');
$this->addSql('DROP TABLE city_reporting_period');
$this->addSql('DROP TABLE currency');
$this->addSql('DROP TABLE exchange_rate');
$this->addSql('DROP TABLE income_operators');
$this->addSql('DROP TABLE income_operator_wage');
$this->addSql('DROP TABLE incomes');
$this->addSql('DROP TABLE income_wage');
$this->addSql('DROP TABLE payment_percent');
$this->addSql('DROP TABLE refresh_tokens');
$this->addSql('DROP TABLE reporting_periods');
$this->addSql('DROP TABLE resources');
$this->addSql('DROP TABLE resources_reporting_period');
$this->addSql('DROP TABLE rights');
$this->addSql('DROP TABLE telegram_message');
$this->addSql('DROP TABLE transactions');
$this->addSql('DROP TABLE user_access');
$this->addSql('DROP TABLE user_access_rights');
$this->addSql('DROP TABLE user_access_groups');
$this->addSql('DROP TABLE user_payment_percentages');
$this->addSql('DROP TABLE user_telegram');
$this->addSql('DROP TABLE users');
$this->addSql('DROP TABLE wage_bonus');
$this->addSql('DROP TABLE wage_fine');
$this->addSql('DROP TABLE wages');
$this->addSql('DROP TABLE workshift_form_result');
}
}