Rails 3: cómo actualizar mis migraciones por esquema de base de datos

I updated my DB schema a I would need to update a migrations by this schema. Exist any elegant way to do it or I have to update my migrations manually?


preguntado el 08 de noviembre de 11 a las 14:11

Would you explain your problem more clearly? -

if I will run the command rake db:schema:dump, so I will get current DB schema. And from this schema I need to generate new migrations. But I don't know how. -

1 Respuestas

You don't generate migrations from the schema.rb file. Instead, use rails generate migration, or generate them as part of your models.

respondido 08 nov., 11:18

thanks Marnen for your reply, but I need to create a migrations. I have an app, I have the schema of database, but I by mistake deleted the migrations of tables from my DB. - user984621

Uh, what? Do you mean that you need to corrida the migrations? I cannot understand what you're asking. Please explain in more detail. - Marnen Laibow-Koser

Well, I deploy my app to server and for creating the database on a server are using migrations. But my problem is, that I have not these migrations. And I don't know, what to do now... - user984621

rake db:schema:load will create the DB from the schema file. Is that what you want? - Marnen Laibow-Koser

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.