如何以升序方式对迁移脚本文件夹进行排序

时间:2013-04-24 17:18:29

标签: ruby-on-rails rails-migrations

如何以升序方式对迁移脚本文件夹进行排序(即,当我执行ls -l命令时,我希望最近创建的脚本位于底部)。目前它以混合的方式出现。

1 个答案:

答案 0 :(得分:0)

在您的Rails根目录中,ls -ltr db/migrate/

或者在db / migrate中,只需ls -ltr


Jason-Kim-MacBook-Pro:composer jkim$ ls -ltr db/migrate/
total 152
-rwxr-xr-x  1 jkim  staff   194 Apr  1 11:20 20130212221628_create_templatings.rb
-rwxr-xr-x  1 jkim  staff   230 Apr  1 11:20 20130212212402_create_locales.rb
-rwxr-xr-x  1 jkim  staff   188 Apr  1 11:20 20130212210032_create_websites.rb
-rwxr-xr-x  1 jkim  staff   270 Apr  1 11:20 20130206224119_create_speaks.rb
-rwxr-xr-x  1 jkim  staff   176 Apr  1 11:20 20130206224111_create_languages.rb
-rwxr-xr-x  1 jkim  staff   176 Apr  1 11:20 20130206224104_create_countries.rb
-rwxr-xr-x  1 jkim  staff   233 Apr  1 11:20 20130107231329_create_imagedescs.rb
-rwxr-xr-x  1 jkim  staff   276 Apr  1 11:20 20130107231313_create_textdescs.rb
-rwxr-xr-x  1 jkim  staff   227 Apr  1 11:20 20121207002247_create_images.rb
-rwxr-xr-x  1 jkim  staff   229 Apr  1 11:20 20121130213128_create_fields.rb
-rwxr-xr-x  1 jkim  staff   240 Apr  1 11:20 20121130213101_create_templates.rb
-rw-r--r--  1 jkim  staff   248 Apr  9 18:38 20130329210956_create_varinstances.rb
-rw-r--r--  1 jkim  staff   181 Apr  9 18:38 20130329203628_create_variables.rb
-rwxr-xr-x  1 jkim  staff  1518 Apr 12 14:51 20130122211324_devise_create_users.rb
-rw-r--r--  1 jkim  staff   201 Apr 12 15:14 20130412213724_create_profiles.rb
-rw-r--r--  1 jkim  staff   257 Apr 17 10:35 20130417173202_change_data_type_for_value_in_varinstance.rb
-rw-r--r--  1 jkim  staff   140 Apr 17 14:27 20130417212708_add_latest_change_made_by_to_pages.rb
-rwxr-xr-x  1 jkim  staff   489 Apr 17 14:27 20121130213117_create_pages.rb
-rw-r--r--  1 jkim  staff   177 Apr 19 14:59 20130418182926_add_locking_attributes_to_pages.rb