From 2df69ad830aea5b67bebc94c05c0879fa61f24d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kurf=C3=BCrst?= Date: Fri, 29 Oct 2021 11:45:21 +0200 Subject: [PATCH] FEATURE: Postgres support --- .../Postgresql/Version20211029094240.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Migrations/Postgresql/Version20211029094240.php diff --git a/Migrations/Postgresql/Version20211029094240.php b/Migrations/Postgresql/Version20211029094240.php new file mode 100644 index 0000000..8370515 --- /dev/null +++ b/Migrations/Postgresql/Version20211029094240.php @@ -0,0 +1,37 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('CREATE TABLE sandstorm_neosacl_domain_model_dynamicrole (persistence_object_identifier VARCHAR(40) NOT NULL, name VARCHAR(255) NOT NULL, abstract BOOLEAN NOT NULL, parentrolenames jsonb NOT NULL, matcher jsonb NOT NULL, privilege VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))'); + $this->addSql('COMMENT ON COLUMN sandstorm_neosacl_domain_model_dynamicrole.parentrolenames IS \'(DC2Type:flow_json_array)\''); + $this->addSql('COMMENT ON COLUMN sandstorm_neosacl_domain_model_dynamicrole.matcher IS \'(DC2Type:flow_json_array)\''); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('DROP TABLE sandstorm_neosacl_domain_model_dynamicrole'); + } +}