From a5612bb83a3ecddfcdfe443e0f3bed0c12cfa9eb Mon Sep 17 00:00:00 2001 From: Wilco Louwerse Date: Tue, 9 Jan 2024 13:56:45 +0100 Subject: [PATCH] Set version default to 0.0.0 instead of 0.0.1 --- api/migrations/Version20240109135300.php | 51 ++++++++++++++++++++++++ api/src/Entity/Action.php | 4 +- api/src/Entity/Application.php | 4 +- api/src/Entity/CollectionEntity.php | 4 +- api/src/Entity/Cronjob.php | 4 +- api/src/Entity/Endpoint.php | 4 +- api/src/Entity/Entity.php | 4 +- api/src/Entity/Gateway.php | 4 +- api/src/Entity/Mapping.php | 4 +- api/src/Entity/Organization.php | 4 +- api/src/Entity/SecurityGroup.php | 4 +- api/src/Entity/Template.php | 4 +- api/src/Entity/User.php | 4 +- 13 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 api/migrations/Version20240109135300.php diff --git a/api/migrations/Version20240109135300.php b/api/migrations/Version20240109135300.php new file mode 100644 index 000000000..60a5facc6 --- /dev/null +++ b/api/migrations/Version20240109135300.php @@ -0,0 +1,51 @@ +addSql('ALTER TABLE action ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE application ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE collection_entity ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE cronjob ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE endpoint ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE entity ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE gateway ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE mapping ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE organization ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE security_group ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE template ALTER version SET DEFAULT \'0.0.0\''); + $this->addSql('ALTER TABLE "user" ALTER version SET DEFAULT \'0.0.0\''); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE action ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE application ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE collection_entity ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE cronjob ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE endpoint ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE entity ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE gateway ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE mapping ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE organization ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE security_group ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE template ALTER version SET DEFAULT \'0.0.1\''); + $this->addSql('ALTER TABLE "user" ALTER version SET DEFAULT \'0.0.1\''); + } +} diff --git a/api/src/Entity/Action.php b/api/src/Entity/Action.php index da3fd2700..a7122de85 100644 --- a/api/src/Entity/Action.php +++ b/api/src/Entity/Action.php @@ -83,9 +83,9 @@ class Action /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var string The name of the action diff --git a/api/src/Entity/Application.php b/api/src/Entity/Application.php index fbb91e3e8..0698bd2ba 100644 --- a/api/src/Entity/Application.php +++ b/api/src/Entity/Application.php @@ -111,9 +111,9 @@ class Application /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * The hosts that this applications uses, keep in ind that a host is exluding a trailing slach / and https:// ot http://. diff --git a/api/src/Entity/CollectionEntity.php b/api/src/Entity/CollectionEntity.php index 9c679cc64..45aa05f46 100644 --- a/api/src/Entity/CollectionEntity.php +++ b/api/src/Entity/CollectionEntity.php @@ -108,9 +108,9 @@ class CollectionEntity /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var ?string The location where the OAS can be loaded from diff --git a/api/src/Entity/Cronjob.php b/api/src/Entity/Cronjob.php index f572197c0..97c2899b6 100644 --- a/api/src/Entity/Cronjob.php +++ b/api/src/Entity/Cronjob.php @@ -104,9 +104,9 @@ class Cronjob /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var string The crontab that determines the interval https://crontab.guru/ diff --git a/api/src/Entity/Endpoint.php b/api/src/Entity/Endpoint.php index 1aa030d7a..898226eb1 100644 --- a/api/src/Entity/Endpoint.php +++ b/api/src/Entity/Endpoint.php @@ -331,9 +331,9 @@ class Endpoint /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * Constructor for creating an Endpoint. Use $entity to create an Endpoint for an Entity or diff --git a/api/src/Entity/Entity.php b/api/src/Entity/Entity.php index 08127f0ea..eeabc188e 100644 --- a/api/src/Entity/Entity.php +++ b/api/src/Entity/Entity.php @@ -421,9 +421,9 @@ class Entity /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; //todo: do we want read/write groups here? /** diff --git a/api/src/Entity/Gateway.php b/api/src/Entity/Gateway.php index 8266b89ee..162a8389c 100644 --- a/api/src/Entity/Gateway.php +++ b/api/src/Entity/Gateway.php @@ -224,9 +224,9 @@ class Gateway /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var string The location where the Gateway needs to be accessed diff --git a/api/src/Entity/Mapping.php b/api/src/Entity/Mapping.php index 04b57e0c5..bfd9412f1 100644 --- a/api/src/Entity/Mapping.php +++ b/api/src/Entity/Mapping.php @@ -79,9 +79,9 @@ class Mapping /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var string The name of the mapping diff --git a/api/src/Entity/Organization.php b/api/src/Entity/Organization.php index 5bb6cff25..2d35d240b 100644 --- a/api/src/Entity/Organization.php +++ b/api/src/Entity/Organization.php @@ -110,9 +110,9 @@ class Organization /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @Groups({"read", "write"}) diff --git a/api/src/Entity/SecurityGroup.php b/api/src/Entity/SecurityGroup.php index a4587ed16..86d573b01 100644 --- a/api/src/Entity/SecurityGroup.php +++ b/api/src/Entity/SecurityGroup.php @@ -111,9 +111,9 @@ class SecurityGroup /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @Groups({"read", "write"}) diff --git a/api/src/Entity/Template.php b/api/src/Entity/Template.php index b6e6f58a7..cbb6d9029 100644 --- a/api/src/Entity/Template.php +++ b/api/src/Entity/Template.php @@ -138,9 +138,9 @@ class Template /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @var Datetime|null The moment this resource was created diff --git a/api/src/Entity/User.php b/api/src/Entity/User.php index 52de1bd39..9b3a1aa2d 100644 --- a/api/src/Entity/User.php +++ b/api/src/Entity/User.php @@ -112,9 +112,9 @@ class User implements PasswordAuthenticatedUserInterface /** * @Groups({"read", "write"}) * - * @ORM\Column(type="string", length=255, nullable=true, options={"default": null}) + * @ORM\Column(type="string", length=255, options={"default": "0.0.0"}) */ - private ?string $version = '0.0.1'; + private string $version = '0.0.0'; /** * @Groups({"write"})