database migration

Ruby code posted
created at 26 Jun 20:28, updated at 06 Jul 14:31

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
  class AddVersions < ActiveRecord::Migration
    def self.up
      # create_versioned_table takes the same options hash
      # that create_table does
      Post.create_versioned_table
    end

    def self.down
      Post.drop_versioned_table
    end
  end
270 Bytes in 2 ms with coderay