aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/migrations
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2011-11-26 17:23:20 +0300
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-06 10:02:45 -0800
commit0968ee3456a874aa46d37d68b2d7d2dd0a84a5fe (patch)
treef1504e923db348b7ee321a2e88e20bf7d5b18d80 /activerecord/test/migrations
parent7eb596cddd75b379ca2ca25955b0bd2af77a89bc (diff)
downloadrails-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')
-rw-r--r--activerecord/test/migrations/rename/1_we_need_things.rb11
-rw-r--r--activerecord/test/migrations/rename/2_rename_things.rb9
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