<?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 Version20201102093913 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add \'developers_rate\' table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE developers_rate (id UUID NOT NULL, project_id UUID DEFAULT NULL, developer_id UUID DEFAULT NULL, inner_rate INT NOT NULL, outer_rate INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_1D2F4A38166D1F9C ON developers_rate (project_id)');
$this->addSql('CREATE INDEX IDX_1D2F4A3864DD9267 ON developers_rate (developer_id)');
$this->addSql('COMMENT ON COLUMN developers_rate.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN developers_rate.project_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN developers_rate.developer_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE developers_rate ADD CONSTRAINT FK_1D2F4A38166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE developers_rate ADD CONSTRAINT FK_1D2F4A3864DD9267 FOREIGN KEY (developer_id) REFERENCES developer (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('DROP TABLE developers_rate');
}
}