Files
postter/db/schema.rb
João Victor Geonizeli 1d692b31f8 add post
2022-02-27 17:02:37 -03:00

48 lines
2.0 KiB
Ruby
Generated

# 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.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_02_27_194054) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "posts", force: :cascade do |t|
t.text "content"
t.bigint "user_id", null: false
t.bigint "quoted_post_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["quoted_post_id"], name: "index_posts_on_quoted_post_id"
t.index ["user_id"], name: "index_posts_on_user_id"
end
create_table "user_follows", force: :cascade do |t|
t.bigint "follower_id"
t.bigint "followed_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["followed_id"], name: "index_user_follows_on_followed_id"
t.index ["follower_id"], name: "index_user_follows_on_follower_id"
end
create_table "users", force: :cascade do |t|
t.string "username", limit: 14, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["username"], name: "index_users_on_username"
end
add_foreign_key "posts", "posts", column: "quoted_post_id"
add_foreign_key "posts", "users"
add_foreign_key "user_follows", "users", column: "followed_id"
add_foreign_key "user_follows", "users", column: "follower_id"
end