Skip to content

Commit

Permalink
Merge pull request #19 from synolia/hotfix/authorized-domain-table-name
Browse files Browse the repository at this point in the history
Change authorized domain table name to snake case
  • Loading branch information
oallain authored Mar 1, 2024
2 parents ae8b8eb + 6720827 commit 3422e4f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
services:
mariadb:
image: 'mariadb:10.4.11'
image: 'mariadb:10.11'
ports:
- '3306:3306'
env:
Expand Down
33 changes: 33 additions & 0 deletions migrations/Version20240221095851.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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 Version20240221095851 extends AbstractMigration
{
public function getDescription(): string
{
return 'Modify AuthorizedDomain table name to snake case';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE AuthorizedDomain RENAME TO synolia_authorized_domain ');
$this->addSql('ALTER TABLE synolia_authorized_domain RENAME COLUMN isEnabled TO is_enabled');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE synolia_authorized_domain RENAME TO AuthorizedDomain ');
$this->addSql('ALTER TABLE AuthorizedDomain RENAME COLUMN is_enabled TO isEnabled');
}
}
3 changes: 2 additions & 1 deletion src/Entity/Domain/AuthorizedDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Sylius\Component\Resource\Model\ResourceInterface;
use Synolia\SyliusAdminOauthPlugin\Repository\AuthorizedDomainRepository;

#[ORM\Table(name: 'synolia_authorized_domain')]
#[ORM\Entity(repositoryClass: AuthorizedDomainRepository::class)]
class AuthorizedDomain implements ResourceInterface
{
Expand All @@ -19,7 +20,7 @@ class AuthorizedDomain implements ResourceInterface
#[ORM\Column(type: 'string', nullable: false)]
private string $name;

#[ORM\Column(type: 'boolean')]
#[ORM\Column(name: 'is_enabled', type: 'boolean')]
private bool $isEnabled = false;

/**
Expand Down

0 comments on commit 3422e4f

Please sign in to comment.