Files
backend/migrations/Version20260213132749.php
2026-05-27 19:36:32 +03:00

45 lines
1.2 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 Version20260213132749 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create article table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE article (
id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
name TEXT,
preview_picture TEXT,
active BOOLEAN DEFAULT NULL,
doctors JSONB DEFAULT NULL,
services JSONB DEFAULT NULL,
region_id INT DEFAULT NULL,
alias TEXT,
anons TEXT,
content TEXT,
update_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL,
PRIMARY KEY (id)
)');
$this->addSql('CREATE INDEX idx_article_active ON article (active)');
$this->addSql('CREATE INDEX idx_article_region_id ON article (region_id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE article');
}
}