diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2011-11-26 17:23:20 +0300 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-06 10:02:45 -0800 |
commit | 0968ee3456a874aa46d37d68b2d7d2dd0a84a5fe (patch) | |
tree | f1504e923db348b7ee321a2e88e20bf7d5b18d80 /activerecord/test/migrations/rename | |
parent | 7eb596cddd75b379ca2ca25955b0bd2af77a89bc (diff) | |
download | rails-0968ee3456a874aa46d37d68b2d7d2dd0a84a5fe.tar.gz rails-0968ee3456a874aa46d37d68b2d7d2dd0a84a5fe.tar.bz2 rails-0968ee3456a874aa46d37d68b2d7d2dd0a84a5fe.zip |
add prefix and suffix to renamed tables, closes #1510
Diffstat (limited to 'activerecord/test/migrations/rename')
-rw-r--r-- | activerecord/test/migrations/rename/1_we_need_things.rb | 11 | ||||
-rw-r--r-- | activerecord/test/migrations/rename/2_rename_things.rb | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/activerecord/test/migrations/rename/1_we_need_things.rb b/activerecord/test/migrations/rename/1_we_need_things.rb new file mode 100644 index 0000000000..cdbe0b1679 --- /dev/null +++ b/activerecord/test/migrations/rename/1_we_need_things.rb @@ -0,0 +1,11 @@ +class WeNeedThings < ActiveRecord::Migration + def self.up + create_table("things") do |t| + t.column :content, :text + end + end + + def self.down + drop_table "things" + end +end
\ No newline at end of file diff --git a/activerecord/test/migrations/rename/2_rename_things.rb b/activerecord/test/migrations/rename/2_rename_things.rb new file mode 100644 index 0000000000..d441b71fc9 --- /dev/null +++ b/activerecord/test/migrations/rename/2_rename_things.rb @@ -0,0 +1,9 @@ +class RenameThings < ActiveRecord::Migration + def self.up + rename_table "things", "awesome_things" + end + + def self.down + rename_table "awesome_things", "things" + end +end
\ No newline at end of file |