2026-03-29 08:16:29 +00:00
< ? 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 Version20260329000003 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
2026-03-29 08:27:57 +00:00
$this -> addSql ( 'CREATE TABLE notification (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, user_id INT NOT NULL, message VARCHAR(255) NOT NULL, is_read BOOLEAN NOT NULL DEFAULT false, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY (id))' );
2026-03-29 08:16:29 +00:00
$this -> addSql ( 'CREATE INDEX IDX_BF5476CAA76ED395 ON notification (user_id)' );
$this -> addSql ( 'COMMENT ON COLUMN notification.created_at IS \'(DC2Type:datetime_immutable)\'' );
$this -> addSql ( 'ALTER TABLE notification ADD CONSTRAINT FK_BF5476CAA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (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 ( 'ALTER TABLE notification DROP CONSTRAINT FK_BF5476CAA76ED395' );
$this -> addSql ( 'DROP TABLE notification' );
}
}