getTable('visits'); $this->skipIf($visits->hasColumn('visited_url')); $shortUrlId = $visits->getColumn('short_url_id'); $shortUrlId->setNotnull(false); $visits->addColumn('visited_url', Types::STRING, [ 'length' => Visitor::VISITED_URL_MAX_LENGTH, 'notnull' => false, ]); $visits->addColumn('type', Types::STRING, [ 'length' => 255, 'default' => Visit::TYPE_VALID_SHORT_URL, ]); } public function down(Schema $schema): void { $visits = $schema->getTable('visits'); $this->skipIf(! $visits->hasColumn('visited_url')); $shortUrlId = $visits->getColumn('short_url_id'); $shortUrlId->setNotnull(true); $visits->dropColumn('visited_url'); $visits->dropColumn('type'); } /** * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 */ public function isTransactional(): bool { return false; } }