37 lines
1.4 KiB
PHP
37 lines
1.4 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 Version20250721091215 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('CREATE TABLE account_login_register (id SERIAL NOT NULL, account_id INT DEFAULT NULL, login_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, user_agent VARCHAR(255) NOT NULL, ip VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
|
$this->addSql('CREATE INDEX IDX_23AAA4819B6B5FBA ON account_login_register (account_id)');
|
|
$this->addSql('COMMENT ON COLUMN account_login_register.login_at IS \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE account_login_register ADD CONSTRAINT FK_23AAA4819B6B5FBA FOREIGN KEY (account_id) REFERENCES "account" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE SCHEMA public');
|
|
$this->addSql('ALTER TABLE account_login_register DROP CONSTRAINT FK_23AAA4819B6B5FBA');
|
|
$this->addSql('DROP TABLE account_login_register');
|
|
}
|
|
}
|