* Reworked how post versioning works, now more closely resembles the 1.18 strategy

This commit is contained in:
albert
2011-01-26 18:10:49 -05:00
parent 683d4583ac
commit f7e2344b9f
21 changed files with 292 additions and 308 deletions

View File

@@ -1,16 +0,0 @@
class CreatePostHistories < ActiveRecord::Migration
def self.up
create_table :post_histories do |t|
t.timestamps
t.column :post_id, :integer, :null => false
t.column :revisions, :text, :null => false
end
add_index :post_histories, :post_id
end
def self.down
drop_table :post_histories
end
end

View File

@@ -0,0 +1,24 @@
class CreatePostVersions < ActiveRecord::Migration
def self.up
create_table :post_versions do |t|
t.timestamps
t.column :post_id, :integer, :null => false
t.column :add_tags, :text, :null => false, :default => ""
t.column :del_tags, :text, :null => false, :default => ""
t.column :rating, :char
t.column :parent_id, :integer
t.column :source, :text
t.column :updater_id, :integer, :null => false
t.column :updater_ip_addr, "inet", :null => false
end
add_index :post_versions, :post_id
add_index :post_versions, :updater_id
add_index :post_versions, :updater_ip_addr
end
def self.down
drop_table :post_versions
end
end