public
Description: Ruby on Rails TextMate bundle [Learn it with PeepCode - http://peepcode.com/products/textmate-for-rails-2]
Homepage: http://groups.google.com/group/rubyonrails-textmate
Clone URL: git://github.com/drnic/ruby-on-rails-tmbundle.git
Search Repo:
Click here to lend your support to: ruby-on-rails-tmbundle and make a donation at www.pledgie.com !
ruby-on-rails-tmbundle / Commands / Migrate to Previous Version.tmCommand
100644 30 lines (27 sloc) 1.008 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>beforeRunningCommand</key>
  <string>nop</string>
  <key>command</key>
  <string>RUBYLIB="$TM_BUNDLE_SUPPORT/lib:$RUBYLIB"
 
# Find the previous version number from the schema.rb file
export PREVIOUS=`grep 'Schema\.define' "$TM_PROJECT_DIRECTORY/db/schema.rb" | ruby -e 'print $stdin.read.scan(/\d+/).first.to_i - 1'`
 
# Migrate database to the previous version
"${TM_RUBY:=ruby}" -- "${TM_BUNDLE_SUPPORT}/bin/rake_helper.rb" db:migrate -v VERSION -a $PREVIOUS
</string>
  <key>input</key>
  <string>none</string>
  <key>keyEquivalent</key>
  <string>^|</string>
  <key>name</key>
  <string>Migrate to Previous Version</string>
  <key>output</key>
  <string>showAsHTML</string>
  <key>scope</key>
  <string>source.ruby.rails, source.yaml</string>
  <key>uuid</key>
  <string>9A1AE6BA-8350-4AB7-B5BD-969A7E64CF29</string>
</dict>
</plist>