Skip to content
Open
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
32 changes: 32 additions & 0 deletions api/migrations/Version20231016091126.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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 Version20231016091126 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->addSql('ALTER TABLE review ALTER author DROP NOT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE review ALTER author SET NOT NULL');
}
}
6 changes: 3 additions & 3 deletions api/src/Entity/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Review
#[ORM\Column(type: 'text')]
public string $body = '';

/** The author of the review. */
#[ORM\Column]
public string $author = '';
/** The author of the review (or null if comment is anonymous) */
#[ORM\Column(nullable: true)]
public ?string $author = null;

/** The date of publication of this review.*/
#[ORM\Column]
Expand Down
6 changes: 4 additions & 2 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@
"type": "string"
},
"author": {
"type": "string"
"type": "string",
"nullable": true
},
"publicationDate": {
"type": "string",
Expand Down Expand Up @@ -969,7 +970,8 @@
"type": "string"
},
"author": {
"type": "string"
"type": "string",
"nullable": true
},
"publicationDate": {
"type": "string",
Expand Down