在服务器上,我有这个:

select * from schema_migrations ;
 version | inserted_at
---------+-------------
(0 rows)

但是当我通过edeliver在Phoenix应用程序中运行“迁移”时
$ mix edeliver migrate production --verbose

我得到这个:
response: RPC to 'my_app@127.0.0.1' failed: {'EXIT',
                                      {#{'__exception__' => true,
                                         '__struct__' => 'Elixir.Ecto.MigrationError',
                                         message => <<"migrations can't be executed, migration version 20160827023221 is duplicated">>},
                                       [{'Elixir.Ecto.Migrator',
                                         ensure_no_duplication,1,
                                         [{file,"lib/ecto/migrator.ex"},
                                          {line,254}]},
                                        {'Elixir.Ecto.Migrator',migrate,4,
                                         [{file,"lib/ecto/migrator.ex"},
                                          {line,235}]},
                                        {rpc,'-handle_call_call/6-fun-0-',5,
                                         [{file,"rpc.erl"},{line,187}]}]}}

MIGRATE DONE!

我在本地也没有两个文件具有相同的迁移号。

最佳答案

重命名迁移文件后,我遇到了同样的问题。在我的情况下,使用'mix clean'命令删除生成的应用程序文件很有帮助。

关于elixir - 迁移是重复的,但实际上不是,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40987810/

10-16 16:45