Sha256: 3033733bfbb262f5aa8eb652fd51c8f0f7d0e2543b9ffa7cd931d02733ad0574

Contents?: true

Size: 909 Bytes

Versions: 6

Compression:

Stored size: 909 Bytes

Contents

class CreateTheblogContentNodes < ActiveRecord::Migration
  def change
    create_table :theblog_content_nodes do |t|
      t.string :type,   null: false
      t.string :title,  null: false
      t.string :slug,   null: false
      t.text :description
      t.text :body
      t.string :tags
      t.references :content_status
      t.references :parent_node
      t.references :author

      t.timestamps
    end

    add_index :theblog_content_nodes, :author_id
    add_index :theblog_content_nodes, :type
    add_index :theblog_content_nodes, :title
    add_index :theblog_content_nodes, :slug
    add_index :theblog_content_nodes, [:type, :slug], unique: true

    add_foreign_key "theblog_content_nodes",
                    "theblog_content_statuses", column: :content_status_id
    add_foreign_key "theblog_content_nodes",
                    "theblog_content_nodes", column: :parent_node_id
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
theblog-0.0.2.3 db/migrate/20150124104006_create_theblog_content_nodes.rb
theblog-0.0.2.2 db/migrate/20150124104006_create_theblog_content_nodes.rb
theblog-0.0.2.1 db/migrate/20150124104006_create_theblog_content_nodes.rb
theblog-0.0.2 db/migrate/20150124104006_create_theblog_content_nodes.rb
theblog-0.0.1.1 db/migrate/20150124104006_create_theblog_content_nodes.rb
theblog-0.0.1 db/migrate/20150124104006_create_theblog_content_nodes.rb