简体   繁体   English

Ruby on Rails:数据库所有以前的迁移号

[英]Ruby on Rails: database all previous migration numbers

If I want to revert my db schema to a specific migration, I would need to know a specific version number. 如果要将数据库模式恢复为特定的迁移,则需要知道特定的版本号。 I checked 我检查了

rake -T

but didn't find any one to list ALL previous db versions. 但找不到任何人列出所有以前的数据库版本。 I am using Rails 4.2.0, and the DB is not versioned using simple integers like 1, 2, ... but timestamp-like integers. 我正在使用Rails 4.2.0,并且数据库未使用简单的整数(例如1、2 ...)进行版本控制,而是使用类似时间戳的整数。

How may I get all the previousdb migration version numbers. 如何获得所有以前的db迁移版本号。

Thanks. 谢谢。

rake db:migrate:status will show all the migrations, along with whether they have been applied or not. rake db:migrate:status将显示所有迁移,以及是否已应用。

` `

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM