Sha256: 35781ac98e772f58ccaf9e37197fae0bd562d9d6a1bf4f01010f4e170a172c93

Contents?: true

Size: 1.26 KB

Versions: 10

Compression:

Stored size: 1.26 KB

Contents

# This migration comes from the_comments_engine (originally 20130101010102)
class CreateComments < ActiveRecord::Migration
  def change
    create_table :comments do |t|
      # relations
      t.integer :user_id
      t.integer :holder_id
      
      # polymorphic, commentable object
      t.integer :commentable_id
      t.string  :commentable_type

      # denormalization
      t.string  :commentable_url
      t.string  :commentable_title
      t.string  :commentable_state

      # comment
      t.string :anchor
      
      t.string :title
      t.string :contacts

      t.text :raw_content
      t.text :content

      # moderation token
      t.string :view_token

      # state machine => :draft | :published | :deleted
      t.string :state, default: :draft

      # base user data (BanHammer power)
      t.string  :ip,             default: :undefined
      t.string  :referer,        default: :undefined
      t.string  :user_agent,     default: :undefined
      t.integer :tolerance_time

      # unusable: for future versions
      t.boolean :spam, default: false

      # nested set
      t.integer :parent_id
      t.integer :lft
      t.integer :rgt
      t.integer :depth, default: 0

      t.timestamps
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
fuck_comments-2.3.4 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments_ruby-2.3.4 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments_ruby-2.3.3 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.3.1 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.2.2 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.2.1 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.2.0 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.1.0 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.0.1 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb
the_comments-2.0.0 spec/dummy_app/db/migrate/20131027185333_create_comments.the_comments_engine.rb