I am trying to migrate from:
{:phoenix, “~> 1.3.1”}
{:phoenix_pubsub, “~> 1.0”}
to
{:phoenix, “~> 1.5.6”}
{:phoenix_pubsub, “~> 2.0.0”}
And the PubSub servers has been defined as:
children = [
supervisor(Phoenix.PubSub.PG2, [:a, []], restart: :permanent, id: :a),
supervisor(Phoenix.PubSub.PG2, [:b, []], restart: :permanent, id: :b),
]
If i define the PubSub servers with the new notation:
children = [
{Phoenix.PubSub, name: :a},
{Phoenix.PubSub, name: :b}
]
I am getting this output log:
{:error, {:start_spec, {:duplicate_child_name, Phoenix.PubSub.Supervisor}}}
And if i try to define it in this other way:
children = [
%{id: :a, start: {Phoenix.PubSub, :start_link, [name: :a]}, type: :supervisor, restart: :permanent},
%{id: :b, start: {Phoenix.PubSub, :start_link, [name: :b]}, type: :supervisor, restart: :permanent},
]
I am getting this output log:
{:error, {:shutdown, {:failed_to_start_child, :pubsub_extension, {:EXIT, {:undef, [ {Phoenix.PubSub, :start_link, [name: :pubsub_extension], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 379]}, {:supervisor, :do_start_child, 2, [file: 'supervisor.erl', line: 365]}, {:supervisor, :"-start_children/2-fun-0-", 3, [file: 'supervisor.erl', line: 349]}, {:supervisor, :children_map, 4, [file: 'supervisor.erl', line: 1157]}, {:supervisor, :init_children, 2, [file: 'supervisor.erl', line: 315]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]} ]}}}}}
Could you help me ?