hasTable("photos_collaborators")) { * $modified = true; * $table = $schema->createTable("photos_collaborators"); * $table->addColumn('album_id', Types::BIGINT, [ * 'notnull' => true, * 'length' => 20, * ]); * $table->addColumn('collaborator_id', Types::STRING, [ * 'notnull' => true, * 'length' => 64, * ]); * $table->addColumn('collaborator_type', Types::INTEGER, [ * 'notnull' => true, * ]); * * $table->addUniqueConstraint(['album_id', 'collaborator_id', 'collaborator_type'], 'collaborators_unique_idx'); * } */ if (!$schema->getTable('photos_albums_files')->hasColumn('owner')) { $modified = true; $table = $schema->getTable('photos_albums_files'); $table->addColumn('owner', Types::STRING, [ 'notnull' => false, 'length' => 64, ]); } if ($modified) { return $schema; } else { return null; } } }