Skip to content

Commit

Permalink
Add support for IPv6 addresses (#216)
Browse files Browse the repository at this point in the history
* Add support for IPv6 addresses

* Change ip max length to 45

* Fix organization default value column definition

Co-authored-by: Nicky Gerritsen <nickygerritsen@me.com>
  • Loading branch information
akondas and Nicky Gerritsen authored Jul 15, 2020
1 parent 67bb3b7 commit cca20bf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Entity/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Organization
private ?Collection $members = null;

/**
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $hasAnonymousAccess = false;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Organization/Package/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Download
private string $version;

/**
* @ORM\Column(type="string", length=15, nullable=true)
* @ORM\Column(type="string", length=45, nullable=true)
*/
private ?string $ip;

Expand Down
37 changes: 37 additions & 0 deletions src/Migrations/Version20200713195731.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace Buddy\Repman\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200713195731 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() 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('ALTER TABLE organization_package_download ALTER ip TYPE VARCHAR(45)');
$this->addSql('ALTER TABLE organization_package_webhook_request ALTER COLUMN ip TYPE VARCHAR(45)');
}

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('ALTER TABLE organization_package_webhook_request ALTER COLUMN ip TYPE VARCHAR(15)');
$this->addSql('ALTER TABLE organization_package_download ALTER ip TYPE VARCHAR(15)');
}
}

0 comments on commit cca20bf

Please sign in to comment.