migrations/Common/Version20200301111213_CompanyUser.php line 1
<?php
declare(strict_types=1);
namespace DoctrineMigrations\Common;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200301111213_CompanyUser extends AbstractMigration
{
public function getDescription(): string
{
return 'Link user to company';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE public.user ADD CONSTRAINT user_company_id_fkey FOREIGN KEY (company_id) REFERENCES company (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
}
public function down(Schema $schema): void
{
$this->addSql("ALTER TABLE public.user DROP CONSTRAINT user_company_id_fkey");
}
}