getTable('short_urls'); if ($shortUrls->hasColumn('max_visits')) { return; } $shortUrls->addColumn('max_visits', Type::INTEGER, [ 'unsigned' => true, 'notnull' => false, ]); } /** * @throws SchemaException */ public function down(Schema $schema): void { $shortUrls = $schema->getTable('short_urls'); if (! $shortUrls->hasColumn('max_visits')) { return; } $shortUrls->dropColumn('max_visits'); } }