48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?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 Version20250626124556 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(<<<'SQL'
|
|
CREATE TABLE user_tab (id SERIAL NOT NULL, users_id INT NOT NULL, tab_open INT NOT NULL, PRIMARY KEY(id))
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
CREATE INDEX IDX_98F5228767B3B43D ON user_tab (users_id)
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
ALTER TABLE user_tab ADD CONSTRAINT FK_98F5228767B3B43D FOREIGN KEY (users_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE
|
|
SQL);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql(<<<'SQL'
|
|
CREATE SCHEMA public
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
ALTER TABLE user_tab DROP CONSTRAINT FK_98F5228767B3B43D
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
DROP TABLE user_tab
|
|
SQL);
|
|
}
|
|
}
|