Skip to content

Commit

Permalink
Fix: use MEDIUMTEXT directly
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Jan 12, 2024
1 parent ecaad93 commit efe4948
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions migrations/Version20231001214111.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ 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 TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE cards CHANGE carddata carddata TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE schedulingobjects CHANGE calendardata calendardata TEXT DEFAULT NULL');
$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
Expand Down
2 changes: 2 additions & 0 deletions migrations/Version20231229203515.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Scale up to MEDIUMTEXT for calendar and card data https://github.com/tchapi/davis/pull/111#issuecomment-1872295498
* ⚠️ This does not fail if the column is already a MEDIUM TEXT, which has allowed us to change a previous migration
* without touching this one (see https://github.com/tchapi/davis/issues/128)
*/
final class Version20231229203515 extends AbstractMigration
{
Expand Down

0 comments on commit efe4948

Please sign in to comment.