migrations/Version20230720074803.php line 1
<?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 Version20230720074803 extends AbstractMigration
{
public function getDescription(): string
{
return 'add table sale_upwork_developer, sale_upwork_developer_skill, sale_upwork_skill';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE sale_upwork_developer (id INT AUTO_INCREMENT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, general_stack VARCHAR(255) NOT NULL, company VARCHAR(255) NOT NULL, in_agency TINYINT(1) NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sale_upwork_developer_skill (developer_id INT NOT NULL, skill_id INT NOT NULL, INDEX IDX_7F175CEA64DD9267 (developer_id), INDEX IDX_7F175CEA5585C142 (skill_id), PRIMARY KEY(developer_id, skill_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sale_upwork_skill (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE sale_upwork_developer_skill ADD CONSTRAINT FK_7F175CEA64DD9267 FOREIGN KEY (developer_id) REFERENCES sale_upwork_developer (id)');
$this->addSql('ALTER TABLE sale_upwork_developer_skill ADD CONSTRAINT FK_7F175CEA5585C142 FOREIGN KEY (skill_id) REFERENCES sale_upwork_skill (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sale_upwork_developer_skill DROP FOREIGN KEY FK_7F175CEA64DD9267');
$this->addSql('ALTER TABLE sale_upwork_developer_skill DROP FOREIGN KEY FK_7F175CEA5585C142');
$this->addSql('DROP TABLE sale_upwork_developer');
$this->addSql('DROP TABLE sale_upwork_developer_skill');
$this->addSql('DROP TABLE sale_upwork_skill');
}
}