You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
<?php |
|
|
|
declare(strict_types=1); |
|
|
|
namespace DoctrineMigrations; |
|
|
|
use Doctrine\DBAL\Schema\Schema; |
|
use Doctrine\Migrations\AbstractMigration; |
|
|
|
/** |
|
* Create unfold_site table for subdomain to naddr mapping |
|
*/ |
|
final class Version20260109120000 extends AbstractMigration |
|
{ |
|
public function getDescription(): string |
|
{ |
|
return 'Create unfold_site table for Unfold subdomain to naddr mapping'; |
|
} |
|
|
|
public function up(Schema $schema): void |
|
{ |
|
$this->addSql('CREATE TABLE unfold_site ( |
|
id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, |
|
subdomain VARCHAR(255) NOT NULL, |
|
naddr VARCHAR(500) NOT NULL, |
|
created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, |
|
updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, |
|
PRIMARY KEY(id) |
|
)'); |
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_UNFOLD_SITE_SUBDOMAIN ON unfold_site (subdomain)'); |
|
$this->addSql("COMMENT ON COLUMN unfold_site.created_at IS '(DC2Type:datetime_immutable)'"); |
|
$this->addSql("COMMENT ON COLUMN unfold_site.updated_at IS '(DC2Type:datetime_immutable)'"); |
|
} |
|
|
|
public function down(Schema $schema): void |
|
{ |
|
$this->addSql('DROP TABLE unfold_site'); |
|
} |
|
} |
|
|
|
|