Migrate comment table
This commit is contained in:
14
db/migrate/20141119131607_create_comments.rb
Normal file
14
db/migrate/20141119131607_create_comments.rb
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
class CreateComments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :comments do |t|
|
||||||
|
t.references :user, index: true
|
||||||
|
t.references :file, index: true
|
||||||
|
t.string :user_type
|
||||||
|
t.integer :row
|
||||||
|
t.integer :column
|
||||||
|
t.string :text
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
14
db/schema.rb
14
db/schema.rb
@ -16,6 +16,20 @@ ActiveRecord::Schema.define(version: 20150317115338) do
|
|||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
create_table "comments", force: true do |t|
|
||||||
|
t.integer "user_id"
|
||||||
|
t.integer "file_id"
|
||||||
|
t.string "user_type"
|
||||||
|
t.integer "row"
|
||||||
|
t.integer "column"
|
||||||
|
t.string "text"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "comments", ["file_id"], name: "index_comments_on_file_id", using: :btree
|
||||||
|
add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
|
||||||
|
|
||||||
create_table "consumers", force: true do |t|
|
create_table "consumers", force: true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
|
Reference in New Issue
Block a user