Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migration is duplicated but it's really not

On a server I have this:

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

But when I'm running "migrate" in my Phoenix application via edeliver

$ mix edeliver migrate production --verbose

I get this:

response: RPC to '[email protected]' 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!

Neither do I have 2 files with the same migration number locally.

like image 448
Kooooro Avatar asked Dec 06 '16 04:12

Kooooro


1 Answers

I had a same kind of problem after renaming the migration file. Deleting generated application files by using 'mix clean' command helped in my case.

like image 123
krisnod Avatar answered Sep 30 '22 08:09

krisnod