test/dummy/db/migrate/20140220140852_posts_archive.rb in archiving-0.3.1 vs test/dummy/db/migrate/20140220140852_posts_archive.rb in archiving-0.4.0
- old
+ new
@@ -1,5 +1,12 @@
-class PostsArchive < ActiveRecord::Migration
+migration_class =
+ if ActiveRecord::VERSION::MAJOR >= 5
+ ActiveRecord::Migration[4.2]
+ else
+ ActiveRecord::Migration
+ end
+
+class PostsArchive < migration_class
def change
create_table :posts_archive do |t|
t.string :title
t.text :body