ruby 我的Schema.rb文件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 我的Schema.rb文件相关的知识,希望对你有一定的参考价值。
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170109072353) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace"
t.text "body"
t.string "resource_id", null: false
t.string "resource_type", null: false
t.string "author_type"
t.integer "author_id"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id", using: :btree
t.index ["namespace"], name: "index_active_admin_comments_on_namespace", using: :btree
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id", using: :btree
end
create_table "admin_users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree
end
create_table "bids", force: :cascade do |t|
t.integer "user_id"
t.integer "product_id"
t.float "ammount"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["product_id"], name: "index_bids_on_product_id", using: :btree
t.index ["user_id"], name: "index_bids_on_user_id", using: :btree
end
create_table "categories", force: :cascade do |t|
t.string "name"
t.string "description"
t.integer "user_id"
t.integer "category_type_id"
t.boolean "enabled"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["category_type_id"], name: "index_categories_on_category_type_id", using: :btree
t.index ["user_id"], name: "index_categories_on_user_id", using: :btree
end
create_table "categories_products", force: :cascade do |t|
t.integer "category_id"
t.integer "product_id"
t.index ["category_id"], name: "index_categories_products_on_category_id", using: :btree
t.index ["product_id"], name: "index_categories_products_on_product_id", using: :btree
end
create_table "category_types", force: :cascade do |t|
t.string "name"
t.string "description"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "delayed_jobs", force: :cascade do |t|
t.integer "priority", default: 0, null: false
t.integer "attempts", default: 0, null: false
t.text "handler", null: false
t.text "last_error"
t.datetime "run_at"
t.datetime "locked_at"
t.datetime "failed_at"
t.string "locked_by"
t.string "queue"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
end
create_table "locations", force: :cascade do |t|
t.string "name"
t.integer "school_id"
t.integer "user_id"
t.boolean "status"
t.string "coordinates"
t.integer "count"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["school_id"], name: "index_locations_on_school_id", using: :btree
t.index ["user_id"], name: "index_locations_on_user_id", using: :btree
end
create_table "product_audits", force: :cascade do |t|
t.integer "product_id"
t.integer "user_id"
t.string "detail"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "action"
t.index ["product_id"], name: "index_product_audits_on_product_id", using: :btree
t.index ["user_id"], name: "index_product_audits_on_user_id", using: :btree
end
create_table "products", force: :cascade do |t|
t.string "title"
t.text "description"
t.float "price"
t.integer "school_id"
t.integer "location_id"
t.integer "category_id"
t.integer "user_id"
t.boolean "explicit"
t.boolean "active"
t.boolean "sold"
t.datetime "auction_end_date"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "condition"
t.integer "sale_type"
t.index ["category_id"], name: "index_products_on_category_id", using: :btree
t.index ["location_id"], name: "index_products_on_location_id", using: :btree
t.index ["school_id"], name: "index_products_on_school_id", using: :btree
t.index ["user_id"], name: "index_products_on_user_id", using: :btree
end
create_table "schools", force: :cascade do |t|
t.string "name"
t.string "identifier"
t.string "url"
t.integer "count"
t.string "state"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "provider"
t.string "uid"
t.string "name"
t.integer "school_id"
t.integer "location_id"
t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
t.index ["location_id"], name: "index_users_on_location_id", using: :btree
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
t.index ["school_id"], name: "index_users_on_school_id", using: :btree
end
create_table "users_users", force: :cascade do |t|
t.integer "user_id"
t.index ["user_id"], name: "index_users_users_on_user_id", using: :btree
end
create_table "votes", force: :cascade do |t|
t.string "votable_type"
t.integer "votable_id"
t.string "voter_type"
t.integer "voter_id"
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope", using: :btree
t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope", using: :btree
end
end
以上是关于ruby 我的Schema.rb文件的主要内容,如果未能解决你的问题,请参考以下文章
Ruby on Rails + Postgres 迁移从每个 db 上的 schema.rb 中删除 enable_extension "pgcrypto":migrate