T
T
tank1232015-12-21 22:38:40
Ruby on Rails
tank123, 2015-12-21 22:38:40

What are the reasons why the migration fails?

94243d84eedc4c9c89ea67a5f67653c2.png
I created a model,
I am running a migration
, what could be the reason that the migration is not suitable?
I checked the latest version of the migration - it says that it passed
but the data cannot be written down
, I attach everything in screenshots

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
vsuhachev, 2015-12-22
@vsuhachev

On the first screen, everything is OK, what you programmed is what you got. If you changed something in the migration file, then you need to rollback the migration back db:rollback and then apply it again. Or even start from scratch: db:drop + db:create + db:migrate

T
tank123, 2015-12-21
@tank123

b8b244039be9420fa81d77e1d2429d8a.png

A
Artem Pyankov, 2015-12-21
@ibub1ik

And why did you decide that the migration does not work? You just have a deprecation warning. As far as I know, if you want to manually bring the test database schema into line with the development schema, you need to use the rake db:test:prepare command.

I
Ilya Lozer, 2015-12-22
@ammet

Judging by the screenshot in the question and the screenshot from the diagrams, you created a model and immediately migrated. Only then did they write code to it.
vsuhachev gave a suitable solution

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question