# 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.define(version: 2023_10_27_042335) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "canisters", force: :cascade do |t| t.string "icid" t.string "name" t.bigint "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["user_id"], name: "index_canisters_on_user_id" end create_table "doodads", force: :cascade do |t| t.text "body" t.bigint "user_id" t.boolean "is_public" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["user_id"], name: "index_doodads_on_user_id" end create_table "friendly_id_slugs", force: :cascade do |t| t.string "slug", null: false t.integer "sluggable_id", null: false t.string "sluggable_type", limit: 50 t.string "scope" t.datetime "created_at" t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type" t.index ["sluggable_type", "sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_type_and_sluggable_id" end create_table "games", force: :cascade do |t| t.string "title" t.datetime "created_at" t.datetime "updated_at" t.string "status" t.integer "controlling_player_id" t.integer "play_to_beat_id" t.integer "winner_player_id" t.integer "table_id" t.index ["play_to_beat_id"], name: "index_games_on_play_to_beat_id" end create_table "play_to_beats", force: :cascade do |t| t.integer "game_id" t.integer "play_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "player_cards", force: :cascade do |t| t.integer "player_id" t.integer "card_id" t.datetime "created_at" t.datetime "updated_at" t.integer "value" t.string "rank" t.string "suit" t.integer "play_id" t.index ["card_id"], name: "index_player_cards_on_card_id" t.index ["player_id"], name: "index_player_cards_on_player_id" end create_table "players", force: :cascade do |t| t.integer "game_id" t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" t.string "soft_token" t.boolean "is_bot", default: false t.index ["game_id"], name: "index_players_on_game_id" t.index ["user_id"], name: "index_players_on_user_id" end create_table "plays", force: :cascade do |t| t.integer "game_id" t.integer "player_id" t.datetime "created_at" t.datetime "updated_at" t.index ["game_id"], name: "index_plays_on_game_id" t.index ["player_id"], name: "index_plays_on_player_id" end create_table "projects", force: :cascade do |t| t.string "title" t.text "description" t.bigint "user_id", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.index ["user_id"], name: "index_projects_on_user_id" end create_table "seats", force: :cascade do |t| t.integer "table_id" t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" t.integer "position" t.string "user_soft_token" t.integer "game_id" t.integer "player_id" t.index ["table_id"], name: "index_seats_on_table_id" t.index ["user_id"], name: "index_seats_on_user_id" end create_table "soft_token_principals", force: :cascade do |t| t.string "soft_token" t.string "principal" end create_table "tables", force: :cascade do |t| t.string "title" t.datetime "created_at" t.datetime "updated_at" t.integer "current_game_id" t.string "skyspace_url" t.string "slug" t.index ["slug"], name: "index_tables_on_slug", unique: true end create_table "tokens", force: :cascade do |t| t.string "canister_id" t.integer "standard" t.string "symbol" t.string "name" t.bigint "total_supply" t.integer "decimals" t.bigint "transfer_fee" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.string "logo_url" t.index ["canister_id"], name: "index_tokens_on_canister_id", unique: true end create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "" 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" t.datetime "updated_at" t.string "name" t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "unconfirmed_email" t.integer "role" t.string "invitation_token" t.datetime "invitation_created_at" t.datetime "invitation_sent_at" t.datetime "invitation_accepted_at" t.integer "invitation_limit" t.integer "invited_by_id" t.string "invited_by_type" t.integer "invitations_count", default: 0 t.string "soft_token" t.integer "win_count", default: 0 t.index ["email"], name: "index_users_on_email", unique: true t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true t.index ["invitations_count"], name: "index_users_on_invitations_count" t.index ["invited_by_id"], name: "index_users_on_invited_by_id" t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end add_foreign_key "canisters", "users" add_foreign_key "doodads", "users" add_foreign_key "projects", "users" end