Skip to content

Commit

Permalink
Merge pull request #1603 from ConductionNL/feature/default-version-fix
Browse files Browse the repository at this point in the history
Set version default to 0.0.0 instead of 0.0.1
  • Loading branch information
WilcoLouwerse authored Jan 9, 2024
2 parents 49420df + a5612bb commit 5e52d7e
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 24 deletions.
51 changes: 51 additions & 0 deletions api/migrations/Version20240109135300.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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 Version20240109135300 extends AbstractMigration
{
public function getDescription(): string
{
return 'Set version default to 0.0.0 (and not nullable)';
}

public function up(Schema $schema): void
{
$this->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\'');
}
}
4 changes: 2 additions & 2 deletions api/src/Entity/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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://.
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/CollectionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Cronjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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?
/**
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/SecurityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down

0 comments on commit 5e52d7e

Please sign in to comment.