nulogy_message_bus_producer 2.0.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +188 -15
  3. data/Rakefile +6 -2
  4. data/db/migrate/20201005150212_rename_tenant_id_and_public.rb +6 -0
  5. data/lib/nulogy_message_bus_producer.rb +47 -19
  6. data/lib/nulogy_message_bus_producer/{base_public_subscription.rb → base_subscription.rb} +1 -1
  7. data/lib/nulogy_message_bus_producer/config.rb +6 -0
  8. data/lib/nulogy_message_bus_producer/repopulate_replication_slots.rb +25 -0
  9. data/lib/nulogy_message_bus_producer/subscriber_graphql_schema_validator.rb +1 -1
  10. data/lib/nulogy_message_bus_producer/{public_subscription.rb → subscription.rb} +1 -2
  11. data/lib/nulogy_message_bus_producer/{public_subscription_event.rb → subscription_event.rb} +1 -1
  12. data/lib/nulogy_message_bus_producer/subscriptions/no_variables.rb +43 -0
  13. data/lib/nulogy_message_bus_producer/subscriptions/postgres_transport.rb +85 -0
  14. data/lib/nulogy_message_bus_producer/subscriptions/risky_subscription_blocker.rb +70 -0
  15. data/lib/nulogy_message_bus_producer/version.rb +1 -1
  16. data/lib/tasks/engine/message_bus_producer.rake +11 -0
  17. data/spec/dummy/config/database.yml +1 -1
  18. data/spec/dummy/config/puma.rb +2 -2
  19. data/spec/dummy/db/migrate/20201005164116_create_active_storage_tables.active_storage.rb +5 -0
  20. data/spec/dummy/db/schema.rb +3 -5
  21. data/spec/dummy/log/development.log +510 -0
  22. data/spec/dummy/log/test.log +18126 -0
  23. data/spec/integration/lib/nulogy_message_bus_producer/repopulate_replication_slots_spec.rb +141 -0
  24. data/spec/integration/lib/nulogy_message_bus_producer/subscriber_graphql_schema_validator_spec.rb +49 -0
  25. data/spec/integration/lib/nulogy_message_bus_producer/subscription_spec.rb +61 -0
  26. data/spec/integration/lib/nulogy_message_bus_producer/subscriptions/no_variables_spec.rb +46 -0
  27. data/spec/integration/lib/nulogy_message_bus_producer/subscriptions/postgres_transport_spec.rb +135 -0
  28. data/spec/integration/lib/nulogy_message_bus_producer/subscriptions/risky_subscription_blocker_spec.rb +49 -0
  29. data/spec/integration_spec_helper.rb +5 -0
  30. data/spec/spec_helper.rb +0 -40
  31. data/spec/support/kafka.rb +105 -0
  32. data/spec/support/kafka_connect.rb +31 -0
  33. data/spec/support/spec_utils.rb +16 -0
  34. data/spec/support/sql_helpers.rb +45 -0
  35. data/spec/support/subscription_helpers.rb +52 -0
  36. data/spec/support/test_graphql_schema.rb +48 -0
  37. metadata +89 -38
  38. data/lib/nulogy_message_bus_producer/postgres_public_subscriptions.rb +0 -117
  39. data/spec/integration/lib/graphql_api/postgres_public_subscriptions_spec.rb +0 -122
  40. data/spec/integration/lib/graphql_api/validators/subscriber_graphql_schema_validator_spec.rb +0 -76
  41. data/spec/unit/lib/graphql_api/models/public_subscription_spec.rb +0 -66
  42. data/spec/unit_spec_helper.rb +0 -6
@@ -1,7 +1,7 @@
1
1
  module NulogyMessageBusProducer
2
2
  # This model saves all subscriptions to external systems.
3
3
  # An external system can subscribe to events and specify the shape of data it would like to receive for the event.
4
- class PublicSubscription < ApplicationRecord
4
+ class Subscription < ApplicationRecord
5
5
  self.table_name = :message_bus_subscriptions
6
6
 
7
7
  # Run our validator with familar syntax in this model
@@ -12,7 +12,6 @@ module NulogyMessageBusProducer
12
12
  validator = NulogyMessageBusProducer::SubscriberGraphqlSchemaValidator.new
13
13
 
14
14
  validator.validate(record)
15
-
16
15
  validator.errors.each { |e| record.errors.add(attribute, e) }
17
16
  end
18
17
  end
@@ -1,7 +1,7 @@
1
1
  module NulogyMessageBusProducer
2
2
  # A model that contains the event data for a particular subscription
3
3
  # It is simply saved in the database and shipped to Kafka by Debezium
4
- class PublicSubscriptionEvent < ApplicationRecord
4
+ class SubscriptionEvent < ApplicationRecord
5
5
  self.table_name = :message_bus_subscription_events
6
6
 
7
7
  def self.create_or_update(attrs)
@@ -0,0 +1,43 @@
1
+ module NulogyMessageBusProducer
2
+ module Subscriptions
3
+ # Query Analyzer that returns an error when a subscription field
4
+ # has variables. See `SUBSCRIPTION_WITH_VARIABLES_MESSAGE`.
5
+ class NoVariables < GraphQL::Analysis::AST::Analyzer
6
+ SUBSCRIPTION_WITH_VARIABLES_MESSAGE = <<~MESSAGE.freeze
7
+ Subscriptions should not be created with arguments. e.g.
8
+
9
+ subscription($id: ID!) { fooWasCreated(id: $id) { ... } }
10
+ with variables { id: id_value, ... }
11
+
12
+ the $id variable should be inlined into the event that they are subscribing to:
13
+
14
+ subscription { fooWasCreated(id: id_value) { ... } }
15
+ MESSAGE
16
+
17
+ def initialize(query_or_multiplex)
18
+ super
19
+ @error = false
20
+ end
21
+
22
+ def analyze?
23
+ subject.subscription?
24
+ end
25
+
26
+ def on_enter_operation_definition(node, _parent, _visitor)
27
+ @error = true if subscription?(node) && node.variables.present?
28
+ end
29
+
30
+ def result
31
+ return unless @error
32
+
33
+ GraphQL::AnalysisError.new(SUBSCRIPTION_WITH_VARIABLES_MESSAGE)
34
+ end
35
+
36
+ private
37
+
38
+ def subscription?(node)
39
+ node.operation_type == "subscription"
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,85 @@
1
+ module NulogyMessageBusProducer
2
+ module Subscriptions
3
+ # Subscription class to `use` when developing Message Bus-backed subscriptions
4
+ # For example,
5
+ #
6
+ # class SomeSchema < GraphQL::Schema
7
+ # ...
8
+ # use NulogyMessageBusProducer::PostgresPublicSubscriptions
9
+ # end
10
+ #
11
+ # It expects that schema to already be registered, or will raise an error.
12
+ #
13
+ # NulogyMessageBusProducer.register_schema("some_schema", "SomeSchema")
14
+ class PostgresTransport < GraphQL::Subscriptions
15
+ def initialize(options = {})
16
+ super
17
+ @schema_key = NulogyMessageBusProducer.resolve_schema_key(options.fetch(:schema))
18
+ end
19
+
20
+ def each_subscription_id(event)
21
+ # The graphql gem camelizes and stringifies the Event's arguments
22
+ # See subscriptions#trigger here: graphql-1.11.4/lib/graphql/subscriptions.rb
23
+ yield event.arguments.fetch("subscriptionId")
24
+ end
25
+
26
+ def read_subscription(subscription_id)
27
+ subscription = Subscription.find(subscription_id)
28
+ context = NulogyMessageBusProducer.context_for_subscription(subscription)
29
+
30
+ {
31
+ context: context,
32
+ operation_name: nil,
33
+ query_string: subscription.query,
34
+ variables: {}
35
+ }
36
+ end
37
+
38
+ def deliver(subscription_id, result)
39
+ if result["errors"]&.any?
40
+ NulogyMessageBusProducer.config.handle_event_generation_error(
41
+ subscription_id: subscription_id,
42
+ context: result.query.context.object,
43
+ variables: result.query.provided_variables,
44
+ result: result
45
+ )
46
+ else
47
+ create_event(subscription_id, result)
48
+ end
49
+ end
50
+
51
+ def write_subscription(query, events)
52
+ events.each do |event|
53
+ Subscription.create_or_update(
54
+ id: event.arguments.fetch(:subscription_id),
55
+ subscription_group_id: event.arguments.fetch(:subscription_group_id),
56
+ event_type: event.name,
57
+ schema_key: @schema_key,
58
+ query: query.query_string,
59
+ topic_name: event.arguments.fetch(:topic_name)
60
+ )
61
+ end
62
+ end
63
+
64
+ def delete_subscription(subscription_id)
65
+ Subscription.find_by(id: subscription_id).destroy
66
+ end
67
+
68
+ private
69
+
70
+ def create_event(subscription_id, result)
71
+ company_uuid = result.query.context.object[:company_uuid]
72
+ subscription = Subscription.find_by(id: subscription_id)
73
+
74
+ SubscriptionEvent.create_or_update(
75
+ id: SecureRandom.uuid,
76
+ subscription_id: subscription_id,
77
+ partition_key: "#{subscription.subscription_group_id},#{company_uuid}",
78
+ company_uuid: company_uuid,
79
+ event_json: result.to_h["data"],
80
+ topic_name: subscription.topic_name
81
+ )
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,70 @@
1
+ module NulogyMessageBusProducer
2
+ module Subscriptions
3
+ # This is a custom AST::Analyzer. It attempts to prevent:
4
+ # 1. Expansions that could take too long
5
+ # 2. Expansions that could be difficult to test
6
+ #
7
+ # We resolved that the causes of (1) would mostly be unbound lists
8
+ # and (2) could be arguments passed to nodes.
9
+ #
10
+ # Thus, as a blunt first step, this analyzer prevents queries from
11
+ # 1. expanding list fields
12
+ # 2. using arguments on nodes
13
+ #
14
+ # While this is fairly strict, it did not affect any existing queries at the time.
15
+ # These could be relaxed in the future but require more-sophisticated techniques.
16
+ # For example, a bounded lists of elements may be required.
17
+ class RiskySubscriptionBlocker < GraphQL::Analysis::AST::Analyzer
18
+ def initialize(query_or_multiplex)
19
+ super
20
+ @nodes_using_arguments = Set.new
21
+ @nodes_are_lists = Set.new
22
+ end
23
+
24
+ PERMITTED_ARGUMENTS = Set.new(%w[subscriptionId subscriptionGroupId topicName])
25
+
26
+ def analyze?
27
+ subject.subscription?
28
+ end
29
+
30
+ def on_enter_argument(argument, parent, _visitor)
31
+ @nodes_using_arguments << parent unless PERMITTED_ARGUMENTS.include?(argument.name)
32
+ end
33
+
34
+ def on_enter_field(node, _parent, visitor)
35
+ @nodes_are_lists << node if list?(node, visitor)
36
+ end
37
+
38
+ def result
39
+ error_messages = []
40
+
41
+ if @nodes_using_arguments.any?
42
+ node_names = @nodes_using_arguments.map(&:name).join("\n")
43
+ error_messages << "Arguments may not be used:\n#{node_names}"
44
+ end
45
+
46
+ if @nodes_are_lists.any?
47
+ node_names = @nodes_are_lists.map(&:name).join("\n")
48
+ error_messages << "Lists may not be queried:\n#{node_names}"
49
+ end
50
+
51
+ GraphQL::AnalysisError.new(error_messages.join("\n\n")) if error_messages.any?
52
+ end
53
+
54
+ private
55
+
56
+ def list?(node, visitor)
57
+ field_definition = visitor.field_definition
58
+ nested_type = field_definition.type_class.type
59
+
60
+ loop do
61
+ @nodes_are_lists << node if nested_type.is_a?(GraphQL::Schema::List)
62
+
63
+ break unless nested_type.respond_to?(:of_type)
64
+
65
+ nested_type = nested_type.of_type
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -1,3 +1,3 @@
1
1
  module NulogyMessageBusProducer
2
- VERSION = "2.0.0".freeze
2
+ VERSION = "3.2.1".freeze
3
3
  end
@@ -0,0 +1,11 @@
1
+ namespace :message_bus_producer do
2
+ desc <<~MESSAGE
3
+ Repopulates the message slots by deleting and re-inserting all of the events in the events table.
4
+
5
+ WARNING: THIS WILL LOCK THE EVENTS TABLE, AND BY EXTENSION ANY DOMAIN LOGIC WHICH EMITS EVENTS.
6
+ THIS IS INTENDED TO BE USED FOR DISASTER RECOVERY ONLY.
7
+ MESSAGE
8
+ task repopulate_replication_slots: :environment do
9
+ NulogyMessageBusProducer::RepopulateReplicationSlots.repopulate
10
+ end
11
+ end
@@ -5,8 +5,8 @@ defaults: &defaults
5
5
  adapter: postgresql
6
6
  username: <%= ENV['NULOGY_MESSAGE_BUS_PRODUCER_DATABASE_USER'] || "nulogy" %>
7
7
  password: <%= ENV['NULOGY_MESSAGE_BUS_PRODUCER_DATABASE_PASS'] || "Nulogy4Ever" %>
8
- template: template_packmanager
9
8
  host: <%= ENV['PM_DATABASE_HOST'] || "localhost" %>
9
+ port: 5437
10
10
  min_messages: warning
11
11
  schema_search_path: "\"$user\", public"
12
12
 
@@ -7,9 +7,9 @@
7
7
  threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
8
  threads threads_count, threads_count
9
9
 
10
- # Specifies the `port` that Puma will listen on to receive requests; default is 3003.
10
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
11
  #
12
- port ENV.fetch("PORT") { 3003 }
12
+ port ENV.fetch("PORT") { 3000 }
13
13
 
14
14
  # Specifies the `environment` that Puma will run in.
15
15
  #
@@ -0,0 +1,5 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
+ def change
4
+ end
5
+ end
@@ -10,19 +10,17 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_06_11_150212) do
13
+ ActiveRecord::Schema.define(version: 2020_10_05_164116) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
- enable_extension "citext"
17
- enable_extension "hstore"
18
16
  enable_extension "plpgsql"
19
17
  enable_extension "uuid-ossp"
20
18
 
21
19
  create_table "message_bus_subscription_events", id: :uuid, default: nil, force: :cascade do |t|
22
- t.uuid "public_subscription_id", null: false
20
+ t.uuid "subscription_id", null: false
23
21
  t.string "partition_key", null: false
24
22
  t.string "topic_name", null: false
25
- t.uuid "tenant_id", null: false
23
+ t.uuid "company_uuid", null: false
26
24
  t.json "event_json", null: false
27
25
  t.datetime "created_at"
28
26
  t.index ["created_at"], name: "index_nulogy_mb_producer_subscription_events_on_created_at"
@@ -1769,3 +1769,513 @@ Migrating to CreatePublicSubscriptionsAndEventsTables (20200611150212)
1769
1769
   (1.1ms) BEGIN
1770
1770
  ActiveRecord::InternalMetadata Update (1.5ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-06-25 20:05:37.691325"], ["key", "environment"]]
1771
1771
   (1.8ms) COMMIT
1772
+  (410.1ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
1773
+  (328.2ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1774
+ SQL (3.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1775
+ SQL (44.3ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1776
+  (2.8ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1777
+  (19.5ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1778
+  (4.6ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1779
+  (1.4ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1780
+  (6.4ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1781
+  (3.4ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1782
+  (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
1783
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1784
+  (2.8ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
1785
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES
1786
+ (20201005164117),
1787
+ (20201005164116),
1788
+ (20200611150212),
1789
+ (20201005150212);
1790
+
1791
+ 
1792
+  (7.9ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1793
+ ActiveRecord::InternalMetadata Load (2.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1794
+  (1.6ms) BEGIN
1795
+ ActiveRecord::InternalMetadata Create (1.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 15:48:30.647330"], ["updated_at", "2020-10-07 15:48:30.647330"]]
1796
+  (1.7ms) COMMIT
1797
+ ActiveRecord::InternalMetadata Load (1.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1798
+  (1.7ms) BEGIN
1799
+  (1.8ms) COMMIT
1800
+ SQL (1.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1801
+ SQL (7.5ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1802
+  (1.7ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1803
+  (8.8ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1804
+  (3.4ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1805
+  (1.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1806
+  (5.6ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1807
+  (4.1ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1808
+  (8.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
1809
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1810
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
1811
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES
1812
+ (20201005164117),
1813
+ (20201005164116),
1814
+ (20200611150212),
1815
+ (20201005150212);
1816
+
1817
+ 
1818
+  (6.1ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1819
+ ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1820
+  (1.0ms) BEGIN
1821
+ ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 15:48:30.787108"], ["updated_at", "2020-10-07 15:48:30.787108"]]
1822
+  (1.4ms) COMMIT
1823
+ ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1824
+  (1.1ms) BEGIN
1825
+ ActiveRecord::InternalMetadata Update (1.6ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 15:48:30.794431"], ["key", "environment"]]
1826
+  (1.4ms) COMMIT
1827
+  (1.3ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
1828
+  (1.6ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1829
+  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1830
+  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1831
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1832
+  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1833
+  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1834
+  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1835
+ SQL (1.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1836
+ SQL (1.9ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1837
+  (4.4ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1838
+  (7.8ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1839
+  (3.4ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1840
+  (3.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1841
+  (6.5ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1842
+  (3.5ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1843
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1844
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1845
+  (1.5ms) BEGIN
1846
+  (1.6ms) COMMIT
1847
+ ActiveRecord::InternalMetadata Load (1.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1848
+  (1.4ms) BEGIN
1849
+  (1.2ms) COMMIT
1850
+ SQL (1.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1851
+ SQL (1.4ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1852
+  (4.2ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1853
+  (7.1ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1854
+  (3.3ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1855
+  (3.0ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1856
+  (6.4ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1857
+  (4.3ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1858
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1859
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1860
+  (1.2ms) BEGIN
1861
+ ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "development"], ["updated_at", "2020-10-07 15:53:28.600948"], ["key", "environment"]]
1862
+  (1.6ms) COMMIT
1863
+ ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1864
+  (1.2ms) BEGIN
1865
+ ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 15:53:28.609152"], ["key", "environment"]]
1866
+  (1.7ms) COMMIT
1867
+  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1868
+  (1.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1869
+  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1870
+  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1871
+  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1872
+  (1.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1873
+  (115.4ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_test"
1874
+  (313.3ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1875
+ SQL (1.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1876
+ SQL (5.9ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1877
+  (1.6ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1878
+  (20.6ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1879
+  (3.8ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1880
+  (1.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1881
+  (6.7ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1882
+  (3.7ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1883
+  (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
1884
+  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1885
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
1886
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES
1887
+ (20201005164117),
1888
+ (20201005164116),
1889
+ (20200611150212),
1890
+ (20201005150212);
1891
+
1892
+ 
1893
+  (6.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1894
+ ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1895
+  (1.3ms) BEGIN
1896
+ ActiveRecord::InternalMetadata Create (1.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 15:53:54.354290"], ["updated_at", "2020-10-07 15:53:54.354290"]]
1897
+  (1.9ms) COMMIT
1898
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1899
+  (1.2ms) BEGIN
1900
+ ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 15:53:54.364764"], ["key", "environment"]]
1901
+  (1.9ms) COMMIT
1902
+  (1.9ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
1903
+  (104.6ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1904
+ SQL (3.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1905
+ SQL (7.1ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1906
+  (2.0ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1907
+  (7.7ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1908
+  (3.3ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1909
+  (1.4ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1910
+  (5.9ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1911
+  (4.7ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1912
+  (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
1913
+  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1914
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
1915
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES
1916
+ (20201005164117),
1917
+ (20201005164116),
1918
+ (20200611150212),
1919
+ (20201005150212);
1920
+
1921
+ 
1922
+  (5.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1923
+ ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1924
+  (1.9ms) BEGIN
1925
+ ActiveRecord::InternalMetadata Create (2.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 15:59:07.619367"], ["updated_at", "2020-10-07 15:59:07.619367"]]
1926
+  (1.9ms) COMMIT
1927
+ ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1928
+  (1.2ms) BEGIN
1929
+  (1.3ms) COMMIT
1930
+ SQL (1.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1931
+ SQL (6.4ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1932
+  (1.4ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1933
+  (9.0ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1934
+  (3.3ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1935
+  (1.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1936
+  (5.7ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1937
+  (3.2ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1938
+  (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
1939
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1940
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
1941
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES
1942
+ (20201005164117),
1943
+ (20201005164116),
1944
+ (20200611150212),
1945
+ (20201005150212);
1946
+
1947
+ 
1948
+  (7.4ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1949
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1950
+  (1.0ms) BEGIN
1951
+ ActiveRecord::InternalMetadata Create (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 15:59:07.749654"], ["updated_at", "2020-10-07 15:59:07.749654"]]
1952
+  (2.4ms) COMMIT
1953
+ ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1954
+  (1.1ms) BEGIN
1955
+ ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 15:59:07.758768"], ["key", "environment"]]
1956
+  (1.7ms) COMMIT
1957
+  (1.7ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
1958
+  (2.5ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1959
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1960
+  (1.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1961
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1962
+  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1963
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1964
+  (1.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
1965
+ SQL (1.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1966
+ SQL (1.9ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1967
+  (4.1ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1968
+  (8.3ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1969
+  (4.2ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1970
+  (3.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1971
+  (6.5ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1972
+  (3.5ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1973
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1974
+ ActiveRecord::InternalMetadata Load (2.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1975
+  (1.6ms) BEGIN
1976
+  (1.4ms) COMMIT
1977
+ ActiveRecord::InternalMetadata Load (1.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1978
+  (2.3ms) BEGIN
1979
+  (1.4ms) COMMIT
1980
+ SQL (1.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1981
+ SQL (1.4ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
1982
+  (4.1ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
1983
+  (7.5ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
1984
+  (3.7ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
1985
+  (2.5ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
1986
+  (5.8ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1987
+  (3.7ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
1988
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1989
+ ActiveRecord::InternalMetadata Load (1.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1990
+  (1.2ms) BEGIN
1991
+ ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "development"], ["updated_at", "2020-10-07 16:02:19.118218"], ["key", "environment"]]
1992
+  (2.0ms) COMMIT
1993
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
1994
+  (1.3ms) BEGIN
1995
+ ActiveRecord::InternalMetadata Update (1.6ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 16:02:19.127263"], ["key", "environment"]]
1996
+  (2.5ms) COMMIT
1997
+  (2.0ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
1998
+  (1.9ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
1999
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2000
+  (1.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2001
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2002
+  (1.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2003
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2004
+  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2005
+ SQL (1.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2006
+ SQL (2.1ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2007
+  (3.7ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2008
+  (6.2ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2009
+  (3.3ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2010
+  (2.6ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2011
+  (6.2ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2012
+  (4.4ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2013
+  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2014
+ ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2015
+  (1.1ms) BEGIN
2016
+  (1.1ms) COMMIT
2017
+ ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2018
+  (1.5ms) BEGIN
2019
+  (1.1ms) COMMIT
2020
+ SQL (1.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2021
+ SQL (1.6ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2022
+  (4.4ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2023
+  (7.6ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2024
+  (3.4ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2025
+  (3.1ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2026
+  (6.4ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2027
+  (3.4ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2028
+  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2029
+ ActiveRecord::InternalMetadata Load (1.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2030
+  (1.5ms) BEGIN
2031
+ ActiveRecord::InternalMetadata Update (1.6ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "development"], ["updated_at", "2020-10-07 16:02:39.454033"], ["key", "environment"]]
2032
+  (1.8ms) COMMIT
2033
+ ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2034
+  (1.3ms) BEGIN
2035
+ ActiveRecord::InternalMetadata Update (1.6ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 16:02:39.463388"], ["key", "environment"]]
2036
+  (2.0ms) COMMIT
2037
+  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2038
+  (1.6ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
2039
+  (2.3ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
2040
+  (2.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2041
+  (2.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2042
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2043
+  (2.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2044
+  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2045
+  (5.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2046
+ SQL (2.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2047
+ SQL (1.8ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2048
+  (8.3ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2049
+  (16.2ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2050
+  (5.4ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2051
+  (6.0ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2052
+  (15.8ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2053
+  (8.4ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2054
+  (3.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2055
+ ActiveRecord::InternalMetadata Load (2.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2056
+  (2.7ms) BEGIN
2057
+  (2.9ms) COMMIT
2058
+ ActiveRecord::InternalMetadata Load (4.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2059
+  (3.8ms) BEGIN
2060
+  (2.0ms) COMMIT
2061
+ SQL (4.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2062
+ SQL (3.8ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2063
+  (9.0ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2064
+  (10.3ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2065
+  (9.5ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2066
+  (7.8ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2067
+  (9.8ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2068
+  (7.3ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2069
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2070
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
2071
+  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES
2072
+ (20201005164117),
2073
+ (20201005164116),
2074
+ (20200611150212),
2075
+ (20201005150212);
2076
+
2077
+ 
2078
+ ActiveRecord::InternalMetadata Load (2.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2079
+  (1.9ms) BEGIN
2080
+ ActiveRecord::InternalMetadata Create (5.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 20:12:35.296503"], ["updated_at", "2020-10-07 20:12:35.296503"]]
2081
+  (4.9ms) COMMIT
2082
+ ActiveRecord::InternalMetadata Load (2.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2083
+  (2.4ms) BEGIN
2084
+ ActiveRecord::InternalMetadata Update (2.5ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 20:12:35.321226"], ["key", "environment"]]
2085
+  (3.7ms) COMMIT
2086
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2087
+  (1.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2088
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2089
+  (1.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2090
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2091
+  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2092
+  (17.4ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_development"
2093
+  (1.4ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_test"
2094
+  (1.8ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_development"
2095
+  (21.6ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_test"
2096
+  (153.7ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
2097
+  (127.1ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
2098
+ SQL (1.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2099
+ SQL (21.6ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2100
+  (1.8ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2101
+  (13.1ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2102
+  (4.9ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2103
+  (1.9ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2104
+  (10.9ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2105
+  (6.7ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2106
+  (9.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2107
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2108
+  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
2109
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES
2110
+ (20201005164117),
2111
+ (20201005164116),
2112
+ (20200611150212),
2113
+ (20201005150212);
2114
+
2115
+ 
2116
+  (8.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2117
+ ActiveRecord::InternalMetadata Load (2.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2118
+  (2.6ms) BEGIN
2119
+ ActiveRecord::InternalMetadata Create (2.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 20:26:17.154304"], ["updated_at", "2020-10-07 20:26:17.154304"]]
2120
+  (2.9ms) COMMIT
2121
+ ActiveRecord::InternalMetadata Load (1.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2122
+  (3.7ms) BEGIN
2123
+  (2.4ms) COMMIT
2124
+ SQL (2.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2125
+ SQL (8.9ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2126
+  (2.3ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2127
+  (15.1ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2128
+  (9.2ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2129
+  (4.9ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2130
+  (9.5ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2131
+  (4.9ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2132
+  (13.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2133
+  (5.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2134
+  (3.8ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164141)
2135
+  (3.2ms) INSERT INTO "schema_migrations" (version) VALUES
2136
+ (20201005164117),
2137
+ (20201005164116),
2138
+ (20200611150212),
2139
+ (20201005150212);
2140
+
2141
+ 
2142
+  (12.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2143
+ ActiveRecord::InternalMetadata Load (2.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2144
+  (1.9ms) BEGIN
2145
+ ActiveRecord::InternalMetadata Create (2.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 20:26:17.388400"], ["updated_at", "2020-10-07 20:26:17.388400"]]
2146
+  (3.1ms) COMMIT
2147
+ ActiveRecord::InternalMetadata Load (2.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2148
+  (2.5ms) BEGIN
2149
+ ActiveRecord::InternalMetadata Update (3.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 20:26:17.406447"], ["key", "environment"]]
2150
+  (4.2ms) COMMIT
2151
+  (2.0ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
2152
+  (1.9ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
2153
+  (12.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2154
+  (2.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2155
+  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2156
+  (2.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2157
+  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2158
+  (2.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2159
+ SQL (5.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2160
+ SQL (2.3ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2161
+  (7.8ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2162
+  (10.9ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2163
+  (5.5ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2164
+  (7.2ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2165
+  (13.1ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2166
+  (5.3ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2167
+  (5.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2168
+ ActiveRecord::InternalMetadata Load (2.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2169
+  (2.9ms) BEGIN
2170
+  (3.2ms) COMMIT
2171
+ ActiveRecord::InternalMetadata Load (5.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2172
+  (4.2ms) BEGIN
2173
+  (2.2ms) COMMIT
2174
+ SQL (2.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2175
+ SQL (2.4ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2176
+  (10.6ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2177
+  (19.4ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2178
+  (5.0ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2179
+  (4.6ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2180
+  (12.3ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2181
+  (7.3ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2182
+  (5.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2183
+ ActiveRecord::InternalMetadata Load (3.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2184
+  (2.8ms) BEGIN
2185
+ ActiveRecord::InternalMetadata Update (3.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "development"], ["updated_at", "2020-10-07 20:27:27.952213"], ["key", "environment"]]
2186
+  (5.4ms) COMMIT
2187
+ ActiveRecord::InternalMetadata Load (4.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2188
+  (3.4ms) BEGIN
2189
+ ActiveRecord::InternalMetadata Update (3.6ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-07 20:27:27.978791"], ["key", "environment"]]
2190
+  (4.4ms) COMMIT
2191
+  (3.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2192
+  (3.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2193
+  (2.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2194
+  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2195
+  (1.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2196
+  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2197
+  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2198
+  (35.5ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_development"
2199
+  (2.1ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_test"
2200
+  (2.1ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_development"
2201
+  (22.8ms) DROP DATABASE IF EXISTS "nulogy_message_bus_producer_test"
2202
+  (188.2ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
2203
+  (122.6ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
2204
+  (9.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2205
+  (5.7ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2206
+  (1.4ms) SELECT pg_try_advisory_lock(3053653019973222135)
2207
+  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2208
+ Migrating to CreatePublicSubscriptionsAndEventsTables (20200611150212)
2209
+  (2.4ms) BEGIN
2210
+ SQL (12.7ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2211
+  (9.7ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2212
+  (4.0ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2213
+  (7.6ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "public_subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "tenant_id" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2214
+  (4.6ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2215
+ ActiveRecord::SchemaMigration Create (2.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200611150212"]]
2216
+  (3.7ms) COMMIT
2217
+ Migrating to RenameTenantIdAndPublic (20201005150212)
2218
+  (3.2ms) BEGIN
2219
+  (3.8ms) ALTER TABLE "message_bus_subscription_events" RENAME COLUMN "tenant_id" TO "company_uuid"
2220
+  (2.2ms) ALTER TABLE "message_bus_subscription_events" RENAME COLUMN "public_subscription_id" TO "subscription_id"
2221
+ ActiveRecord::SchemaMigration Create (1.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20201005150212"]]
2222
+  (2.0ms) COMMIT
2223
+ Migrating to CreateActiveStorageTables (20201005164116)
2224
+  (1.4ms) BEGIN
2225
+ ActiveRecord::SchemaMigration Create (2.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20201005164116"]]
2226
+  (3.1ms) COMMIT
2227
+ ActiveRecord::InternalMetadata Load (2.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2228
+  (2.3ms) BEGIN
2229
+ ActiveRecord::InternalMetadata Create (7.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-07 20:34:57.122757"], ["updated_at", "2020-10-07 20:34:57.122757"]]
2230
+  (2.9ms) COMMIT
2231
+  (2.0ms) SELECT pg_advisory_unlock(3053653019973222135)
2232
+  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2233
+  (1.2ms) CREATE DATABASE "nulogy_message_bus_producer_development" ENCODING = 'utf8'
2234
+  (1.8ms) CREATE DATABASE "nulogy_message_bus_producer_test" ENCODING = 'utf8'
2235
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2236
+  (2.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2237
+  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2238
+  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2239
+  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2240
+  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
2241
+ SQL (2.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2242
+ SQL (1.3ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2243
+  (7.8ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2244
+  (17.2ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2245
+  (3.0ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2246
+  (2.4ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2247
+  (3.8ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2248
+  (2.3ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2249
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2250
+ ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2251
+  (1.0ms) BEGIN
2252
+  (1.3ms) COMMIT
2253
+ ActiveRecord::InternalMetadata Load (1.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2254
+  (1.1ms) BEGIN
2255
+  (0.9ms) COMMIT
2256
+ SQL (1.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2257
+ SQL (13.6ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2258
+  (2.4ms) DROP TABLE IF EXISTS "message_bus_subscription_events" CASCADE
2259
+  (17.5ms) CREATE TABLE "message_bus_subscription_events" ("id" uuid NOT NULL PRIMARY KEY, "subscription_id" uuid NOT NULL, "partition_key" character varying NOT NULL, "topic_name" character varying NOT NULL, "company_uuid" uuid NOT NULL, "event_json" json NOT NULL, "created_at" timestamp)
2260
+  (2.8ms) CREATE INDEX "index_nulogy_mb_producer_subscription_events_on_created_at" ON "message_bus_subscription_events" ("created_at")
2261
+  (1.1ms) DROP TABLE IF EXISTS "message_bus_subscriptions" CASCADE
2262
+  (4.7ms) CREATE TABLE "message_bus_subscriptions" ("id" uuid NOT NULL PRIMARY KEY, "subscription_group_id" uuid NOT NULL, "event_type" character varying NOT NULL, "topic_name" character varying NOT NULL, "query" character varying NOT NULL, "schema_key" text NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2263
+  (2.8ms) CREATE INDEX "index_nulogy_mb_producer_subscriptions_on_event_type" ON "message_bus_subscriptions" ("event_type")
2264
+  (4.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2265
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2266
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20201005164116)
2267
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES
2268
+ (20200611150212),
2269
+ (20201005150212);
2270
+
2271
+ 
2272
+  (4.3ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2273
+ ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2274
+  (1.1ms) BEGIN
2275
+ ActiveRecord::InternalMetadata Create (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-10-08 19:11:47.210016"], ["updated_at", "2020-10-08 19:11:47.210016"]]
2276
+  (1.5ms) COMMIT
2277
+ ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
2278
+  (0.9ms) BEGIN
2279
+ ActiveRecord::InternalMetadata Update (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2020-10-08 19:11:47.218022"], ["key", "environment"]]
2280
+  (1.3ms) COMMIT
2281
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC