Removed file related fields from book entity except fo the cover.

This commit is contained in:
krzysiej
2022-05-20 15:13:22 +02:00
parent cf3b357300
commit d8b2f1c798
2 changed files with 32 additions and 30 deletions

View File

@@ -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 Version20220520130832 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('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, book_id INT NOT NULL, file_name VARCHAR(255) NOT NULL, file_size INT NOT NULL, extension VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_8C9F361016A2B381 (book_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F361016A2B381 FOREIGN KEY (book_id) REFERENCES book (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE file');
}
}

View File

@@ -30,12 +30,6 @@ class Book
#[ORM\Column(type: 'date', nullable: true)]
private $publish_date;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $filename;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $original_filename;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $subtitle;
@@ -112,30 +106,6 @@ class Book
return $this;
}
public function getFilename(): ?string
{
return $this->filename;
}
public function setFilename(?string $filename): self
{
$this->filename = $filename;
return $this;
}
public function getOriginalFilename(): ?string
{
return $this->original_filename;
}
public function setOriginalFilename(?string $original_filename): self
{
$this->original_filename = $original_filename;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;