Sha256: 43a51fd7577ee2d4874530bd57c80fd1265edad27c85ac87ee74e8ae8b17d2a8

Contents?: true

Size: 1.14 KB

Versions: 57

Compression:

Stored size: 1.14 KB

Contents

module Brightbox
  command [:sql] do |product|
    product.command [:snapshots] do |cmd|
      cmd.desc I18n.t("sql.snapshots.lock.desc")
      cmd.arg_name "[snapshot-id...]"
      cmd.command [:lock] do |c|
        c.action do |_global_options, _options, args|
          raise "You must specify sql snapshots as arguments" if args.empty?

          snapshots = DatabaseSnapshot.find_or_call(args) do |snapshot|
            raise "Couldn't find #{snapshot}"
          end

          snapshots.each do |snapshot|
            info "Locking #{snapshot}"
            snapshot.lock!
          end
        end
      end

      cmd.desc I18n.t("sql.snapshots.unlock.desc")
      cmd.arg_name "[snapshot-id...]"
      cmd.command [:unlock] do |c|
        c.action do |_global_options, _options, args|
          raise "You must specify sql snapshots as arguments" if args.empty?

          snapshots = DatabaseSnapshot.find_or_call(args) do |snapshot|
            raise "Couldn't find #{snapshot}"
          end

          snapshots.each do |snapshot|
            info "Unlocking #{snapshot}"
            snapshot.unlock!
          end
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0.rc2 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-5.0.0.rc1 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-5.0.0.alpha lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.8.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.7.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.6.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.5.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.4.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.3.2 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.3.1 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.3.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.2.1 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.2.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.1.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.0.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-3.3.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-3.2.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb
brightbox-cli-3.1.0 lib/brightbox-cli/commands/sql/snapshots_locking.rb