mirror of
https://github.com/tchapi/davis.git
synced 2025-04-21 21:11:59 +02:00
Switch to MEDIUMTEXT for card and calendar data (#127)
This commit is contained in:
parent
4cdf1f91e7
commit
ecaad935ba
37
migrations/Version20231229203515.php
Normal file
37
migrations/Version20231229203515.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Scale up to MEDIUMTEXT for calendar and card data https://github.com/tchapi/davis/pull/111#issuecomment-1872295498
|
||||
*/
|
||||
final class Version20231229203515 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Scale up to MEDIUMTEXT for calendar and card data';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration is specific to \'mysql\'. Skipping it is fine.');
|
||||
|
||||
$this->addSql('ALTER TABLE calendarobjects CHANGE calendardata calendardata MEDIUMTEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE cards CHANGE carddata carddata MEDIUMTEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE schedulingobjects CHANGE calendardata calendardata MEDIUMTEXT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration is specific to \'mysql\'. Skipping it is fine.');
|
||||
|
||||
$this->addSql('ALTER TABLE schedulingobjects CHANGE calendardata calendardata TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE calendarobjects CHANGE calendardata calendardata TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE cards CHANGE carddata carddata TEXT DEFAULT NULL');
|
||||
}
|
||||
}
|
@ -21,7 +21,8 @@ class CalendarObject
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="calendardata", type="text", nullable=true, length=65535)
|
||||
* @ORM\Column(name="calendardata", type="text", nullable=true, length=16777215)
|
||||
* The length corresponds to MEDIUMTEXT in MySQL
|
||||
*/
|
||||
private $calendarData;
|
||||
|
||||
|
@ -28,7 +28,8 @@ class Card
|
||||
private $addressBook;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="carddata", type="text", nullable=true, length=65535)
|
||||
* @ORM\Column(name="carddata", type="text", nullable=true, length=16777215)
|
||||
* The length corresponds to MEDIUMTEXT in MySQL
|
||||
*/
|
||||
private $cardData;
|
||||
|
||||
|
@ -27,7 +27,8 @@ class SchedulingObject
|
||||
private $principalUri;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="calendardata", type="text", nullable=true, length=65535)
|
||||
* @ORM\Column(name="calendardata", type="text", nullable=true, length=16777215)
|
||||
* The length corresponds to MEDIUMTEXT in MySQL
|
||||
*/
|
||||
private $calendarData;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user