public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE public.news_category (id UUID NOT NULL, parent_id UUID DEFAULT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, name VARCHAR(255) 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 INDEX IDX_73310D3C727ACA70 ON public.news_category (parent_id)');
$this->addSql('CREATE INDEX IDX_73310D3CDE12AB56 ON public.news_category (created_by)');
$this->addSql('CREATE INDEX IDX_73310D3C16FE72E1 ON public.news_category (updated_by)');
$this->addSql('COMMENT ON COLUMN public.news_category.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN public.news_category.parent_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN public.news_category.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN public.news_category.updated_by IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE public."user" (id UUID NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_327C5DE7E7927C74 ON public."user" (email)');
$this->addSql('COMMENT ON COLUMN public."user".id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE public.news_category ADD CONSTRAINT FK_73310D3C727ACA70 FOREIGN KEY (parent_id) REFERENCES public.news_category (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE public.news_category ADD CONSTRAINT FK_73310D3CDE12AB56 FOREIGN KEY (created_by) REFERENCES public."user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE public.news_category ADD CONSTRAINT FK_73310D3C16FE72E1 FOREIGN KEY (updated_by) REFERENCES public."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 public.news_category DROP CONSTRAINT FK_73310D3C727ACA70');
$this->addSql('ALTER TABLE public.news_category DROP CONSTRAINT FK_73310D3CDE12AB56');
$this->addSql('ALTER TABLE public.news_category DROP CONSTRAINT FK_73310D3C16FE72E1');
$this->addSql('DROP TABLE public.news_category');
$this->addSql('DROP TABLE public."user"');
}