迁移是重复的,但事实并非如此

Koo*_*oro 4 elixir phoenix-framework

在服务器上我有这个:

select * from schema_migrations ;
 version | inserted_at 
---------+-------------
(0 rows)
Run Code Online (Sandbox Code Playgroud)

但是当我通过edeliver在我的凤凰应用程序中运行"迁移"时

$ mix edeliver migrate production --verbose
Run Code Online (Sandbox Code Playgroud)

我明白了:

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!
Run Code Online (Sandbox Code Playgroud)

我本地也没有2个具有相同迁移号的文件.

小智 7

重命名迁移文件后,我遇到了同样的问题.在我的案例中,使用'mix clean'命令删除生成的应用程序文件.