Class: Pgbus::Generators::AddStreamQueuesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration, MigrationPath
Defined in:
lib/generators/pgbus/add_stream_queues_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



23
24
25
26
# File 'lib/generators/pgbus/add_stream_queues_generator.rb', line 23

def create_migration_file
  migration_template "add_stream_queues.rb.erb",
                     File.join(pgbus_migrate_path, "add_pgbus_stream_queues.rb")
end

#display_post_installObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/generators/pgbus/add_stream_queues_generator.rb', line 28

def display_post_install
  say ""
  say "Pgbus stream queue registry installed!", :green
  say ""
  say "Without this table, stream queues are indistinguishable from job"
  say "queues: per-stream archive retention and the orphan sweep skip them,"
  say "and wildcard ('*') workers can claim durable broadcasts. Existing"
  say "streams register themselves on their next broadcast after migrating."
  say ""
  say "Next steps:"
  say "  1. Run: rails db:migrate#{":#{options[:database]}" if separate_database?}"
  say "  2. Restart pgbus: bin/pgbus start"
  say ""
end