Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added version = 0.0.1 as default value for all Entity #1596

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions api/migrations/Version20231219151046.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 Version20231219151046 extends AbstractMigration
{
public function getDescription(): string
{
return 'Set version default to 0.0.1';
}

public function up(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\'');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE action ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE application ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE collection_entity ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE cronjob ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE endpoint ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE entity ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE gateway ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE mapping ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE organization ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE security_group ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE template ALTER version SET DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ALTER version SET DEFAULT NULL');
}
}
2 changes: 1 addition & 1 deletion api/src/Entity/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Action
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $version;
private ?string $version = '0.0.1';

/**
* @var string The name of the action
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Application
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* The hosts that this applications uses, keep in ind that a host is exluding a trailing slach / and https:// ot http://.
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/CollectionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CollectionEntity
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @var ?string The location where the OAS can be loaded from
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Cronjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Cronjob
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @var string The crontab that determines the interval https://crontab.guru/
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class Endpoint
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* Constructor for creating an Endpoint. Use $entity to create an Endpoint for an Entity or
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class Entity
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

//todo: do we want read/write groups here?
/**
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class Gateway
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @var string The location where the Gateway needs to be accessed
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Mapping
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @var string The name of the mapping
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Organization
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @Groups({"read", "write"})
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/SecurityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class SecurityGroup
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @Groups({"read", "write"})
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Template
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @var Datetime|null The moment this resource was created
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class User implements PasswordAuthenticatedUserInterface
*
* @ORM\Column(type="string", length=255, nullable=true, options={"default": null})
*/
private ?string $version = null;
private ?string $version = '0.0.1';

/**
* @Groups({"write"})
Expand Down
Loading