<?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 Version20220919055732 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 TABLE "users_analytics" (id INT NOT NULL, invoice_period_id INT NOT NULL, user_id INT NOT NULL, user_invoice_period_id INT NOT NULL, solve_problems TEXT DEFAULT NULL, call_analysis TEXT DEFAULT NULL, final_characteristic TEXT DEFAULT NULL, customer_focus INT DEFAULT 0 NOT NULL, informal_communication INT DEFAULT 0 NOT NULL, decision_speed INT DEFAULT 0 NOT NULL, material_knowledge INT DEFAULT 0 NOT NULL, job_title VARCHAR(255) DEFAULT NULL, additional_work VARCHAR(255) DEFAULT NULL, published BOOLEAN DEFAULT \'false\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_8CBF9C6989248B42 ON "users_analytics" (invoice_period_id)');
$this->addSql('CREATE INDEX IDX_8CBF9C69A76ED395 ON "users_analytics" (user_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8CBF9C69713B3069 ON "users_analytics" (user_invoice_period_id)');
$this->addSql('ALTER TABLE "users_analytics" ADD CONSTRAINT FK_8CBF9C6989248B42 FOREIGN KEY (invoice_period_id) REFERENCES "invoices_periods" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE "users_analytics" ADD CONSTRAINT FK_8CBF9C69A76ED395 FOREIGN KEY (user_id) REFERENCES "users" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE "users_analytics" ADD CONSTRAINT FK_8CBF9C69713B3069 FOREIGN KEY (user_invoice_period_id) REFERENCES "users_invoices_periods" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE shifts ADD need_analytics BOOLEAN DEFAULT \'false\' NOT NULL');
$this->addSql('ALTER TABLE users ADD started_job TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE users ADD img VARCHAR(255) DEFAULT NULL');
}
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 TABLE "users_analytics"');
$this->addSql('ALTER TABLE "users" DROP started_job');
$this->addSql('ALTER TABLE "users" DROP img');
$this->addSql('ALTER TABLE "shifts" DROP need_analytics');
}
}