<?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 Version20211211182912 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE notifications.templates ADD COLUMN type smallint DEFAULT 1 ");
$this->addSql("
CREATE TABLE notifications.push_mobiles (
id SERIAL,
content TEXT NOT NULL,
context JSON DEFAULT NULL,
user_id INT DEFAULT NULL,
status SMALLINT DEFAULT 0,
created_at timestamp(0) without time zone DEFAULT NOW()::timestamp without time zone,
updated_at timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
deleted_at timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
created_by integer,
updated_by integer,
deleted_by integer,
enabled smallint DEFAULT 1 NOT NULL,
deleted smallint DEFAULT 0 NOT NULL,
PRIMARY KEY(id)
)
");
$this->addSql("
CREATE TRIGGER tgr_push_mobiles__main_table_history
BEFORE INSERT OR UPDATE
ON notifications.push_mobiles
FOR EACH ROW EXECUTE PROCEDURE main_table_history();
");
}
public function down(Schema $schema): void
{
$this->addSql("ALTER TABLE notifications.templates DROP COLUMN type;");
$this->addSql("DROP TABLE notifications.push_mobiles");
}
}