Sha256: 9430761531f766bcd31d0a501d56ee5c77c2882b1b604894c8350a33d9b08b9c

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Karafka
  module Web
    class Cli
      # Migrates the Web UI topics and states if needed
      class Migrate < Base
        desc 'Runs necessary migrations of Web UI topics and states'

        option(
          :replication_factor,
          'Replication factor for created topics',
          Integer,
          ['--replication_factor [FACTOR]']
        )

        # Creates new topics (if any) and populates missing data.
        # It does **not** remove topics and will not populate data if it is already there.
        #
        # Useful in two scenarios:
        #   1. When setting up Web-UI in a new environment, so the Web-UI has the proper initial
        #      state.
        #   2. When upgrading Web-UI in-between versions that would require extra topics and/or
        #      extra states populated.
        def call
          Karafka::Web::Installer.new.migrate(
            replication_factor: compute_replication_factor(options[:replication_factor])
          )
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
karafka-web-0.10.4 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.3 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.2 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.1 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.0 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.0.rc2 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.0.rc1 lib/karafka/web/cli/migrate.rb
karafka-web-0.10.0.beta1 lib/karafka/web/cli/migrate.rb
karafka-web-0.9.1 lib/karafka/web/cli/migrate.rb
karafka-web-0.9.0 lib/karafka/web/cli/migrate.rb
karafka-web-0.9.0.rc3 lib/karafka/web/cli/migrate.rb
karafka-web-0.9.0.rc2 lib/karafka/web/cli/migrate.rb
karafka-web-0.9.0.rc1 lib/karafka/web/cli/migrate.rb
karafka-web-0.8.2 lib/karafka/web/cli/migrate.rb
karafka-web-0.8.1 lib/karafka/web/cli/migrate.rb
karafka-web-0.8.0 lib/karafka/web/cli/migrate.rb
karafka-web-0.8.0.rc1 lib/karafka/web/cli/migrate.rb
karafka-web-0.7.10 lib/karafka/web/cli/migrate.rb
karafka-web-0.7.9 lib/karafka/web/cli/migrate.rb
karafka-web-0.7.8 lib/karafka/web/cli/migrate.rb