我正在迁移,但未收到任何错误或成功消息:
up do
create_table :libro_prestamos do
column :id, Integer, :serial => true
column :estado, Integer
column :fecha_prestamo, Date
column :fecha_entrega, Date
column :fecha_devolucion_real, Date
column :observacion, 'text'
column :usuario_id, 'INT(10) UNSIGNED'
column :libro_copia_id, 'INT(10) UNSIGNED'
column :created_at, DateTime
column :updated_at, DateTime
column :deleted_at, DateTime
end
create_table :libro_editoriales do
column :id, Integer, :serial => true
column :nombre, 'VARCHAR(300)'
column :created_at, DateTime
column :updated_at, DateTime
column :deleted_at, DateTime
end
modify_table :titulos_libros do
add_column :isbn, 'VARCHAR(200)'
add_column :stock_copias, 'INT(10) UNSIGNED'
add_column :libro_editorial_id, 'INT(10) UNSIGNED'
end
end
down do
drop_table :libro_prestamos
drop_table :libro_editoriales
modify_table :titulos_libros do
drop_column :isbn
drop_column :stock_copias
drop_column :libro_editorial_id
end
end
答案 0 :(得分:0)
它是self.up
和self.down
,而不仅仅是up
和down
(我想您对change
方法感到困惑)