/
Dmitry-F
/
cbt_tool
Обзор
Документация
Войти
/
Dmitry-F
/
cbt_tool
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
db/schema.rb
144 строки
7 KB
Dmitriy-Filatov
Глобальный полнотекстовый поиск (FTS) внедрён
19 мар 2026, 21:45
19 мар 2026, 21:45
94b70c9
Код
Авторство
О чём код?
# 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[8.1].define(version: 2026_03_18_145613) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_catalog.plpgsql" create_table "action_text_rich_texts", force: :cascade do |t| t.text "body" t.datetime "created_at", null: false t.string "name", null: false t.bigint "record_id", null: false t.string "record_type", null: false t.datetime "updated_at", null: false t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true end create_table "active_storage_attachments", force: :cascade do |t| t.bigint "blob_id", null: false t.datetime "created_at", null: false t.string "name", null: false t.bigint "record_id", null: false t.string "record_type", null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end create_table "active_storage_blobs", force: :cascade do |t| t.bigint "byte_size", null: false t.string "checksum" t.string "content_type" t.datetime "created_at", null: false t.string "filename", null: false t.string "key", null: false t.text "metadata" t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end create_table "active_storage_variant_records", force: :cascade do |t| t.bigint "blob_id", null: false t.string "variation_digest", null: false t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true end create_table "clients", force: :cascade do |t| t.datetime "created_at", null: false t.citext "email" t.citext "name" t.text "notes" t.string "phone" t.virtual "search_vector", type: :tsvector, as: "(setweight(to_tsvector('russian'::regconfig, COALESCE((name)::text, ''::text)), 'A'::\"char\") || setweight(to_tsvector('russian'::regconfig, COALESCE((email)::text, ''::text)), 'A'::\"char\"))", stored: true t.integer "sessions_count", default: 0, null: false t.integer "smer_diary_entries_count", default: 0, null: false t.bigint "therapist_id", null: false t.datetime "updated_at", null: false t.index ["email", "therapist_id"], name: "index_clients_on_email_and_therapist_id", unique: true t.index ["email"], name: "index_clients_on_email_for_search" t.index ["name"], name: "index_clients_on_name_for_search" t.index ["phone"], name: "index_clients_on_phone_for_search" t.index ["search_vector"], name: "index_clients_on_search_vector", using: :gin t.index ["therapist_id"], name: "index_clients_on_therapist_id" end create_table "sessions", force: :cascade do |t| t.bigint "client_id", null: false t.datetime "created_at", null: false t.text "homework" t.text "notes" t.virtual "search_vector", type: :tsvector, as: "(setweight(to_tsvector('russian'::regconfig, (COALESCE(topic, ''::character varying))::text), 'B'::\"char\") || setweight(to_tsvector('russian'::regconfig, COALESCE(notes, ''::text)), 'B'::\"char\"))", stored: true t.date "session_date" t.bigint "therapist_id", null: false t.string "topic" t.datetime "updated_at", null: false t.index ["client_id", "session_date", "created_at"], name: "index_sessions_on_client_date_created" t.index ["client_id"], name: "index_sessions_on_client_id" t.index ["notes"], name: "index_sessions_on_notes_for_search" t.index ["search_vector"], name: "index_sessions_on_search_vector", using: :gin t.index ["therapist_id", "session_date"], name: "index_sessions_on_therapist_and_date" t.index ["topic"], name: "index_sessions_on_topic_for_search" end create_table "smer_diary_diary_entries", force: :cascade do |t| t.jsonb "ai_analysis" t.text "alternative_thought" t.jsonb "aqal_data" t.bigint "client_id" t.datetime "created_at", null: false t.text "emotion" t.text "event" t.text "evidence_against" t.text "evidence_for" t.integer "intensity" t.jsonb "metadata" t.datetime "occurred_at" t.text "reaction" t.virtual "search_vector", type: :tsvector, as: "((((((setweight(to_tsvector('russian'::regconfig, COALESCE(thought, ''::text)), 'A'::\"char\") || setweight(to_tsvector('russian'::regconfig, COALESCE(event, ''::text)), 'A'::\"char\")) || setweight(to_tsvector('russian'::regconfig, COALESCE(emotion, ''::text)), 'B'::\"char\")) || setweight(to_tsvector('russian'::regconfig, COALESCE(reaction, ''::text)), 'B'::\"char\")) || setweight(to_tsvector('russian'::regconfig, COALESCE(evidence_for, ''::text)), 'C'::\"char\")) || setweight(to_tsvector('russian'::regconfig, COALESCE(evidence_against, ''::text)), 'C'::\"char\")) || setweight(to_tsvector('russian'::regconfig, COALESCE(alternative_thought, ''::text)), 'C'::\"char\"))", stored: true t.text "thought" t.text "transcription" t.datetime "updated_at", null: false t.index ["client_id", "created_at"], name: "index_smer_diary_diary_entries_on_client_id_and_created_at" t.index ["client_id"], name: "index_smer_diary_diary_entries_on_client_id" t.index ["emotion"], name: "index_smer_diary_entries_on_emotion_for_search" t.index ["event"], name: "index_smer_diary_entries_on_event_for_search" t.index ["reaction"], name: "index_smer_diary_entries_on_reaction_for_search" t.index ["search_vector"], name: "index_smer_diary_diary_entries_on_search_vector", using: :gin t.index ["thought"], name: "index_smer_diary_entries_on_thought_for_search" end create_table "solid_cable_messages", force: :cascade do |t| t.string "channel", null: false t.datetime "created_at", null: false t.binary "payload", null: false t.datetime "updated_at", null: false t.index ["channel"], name: "index_solid_cable_messages_on_channel" t.index ["id"], name: "index_solid_cable_messages_on_id", unique: true end create_table "therapists", force: :cascade do |t| t.datetime "created_at", null: false t.string "email" t.string "name" t.string "password_digest" t.datetime "updated_at", null: false t.index ["email"], name: "index_therapists_on_email", unique: true end add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "clients", "therapists" add_foreign_key "sessions", "clients" add_foreign_key "sessions", "therapists" add_foreign_key "smer_diary_diary_entries", "clients", on_delete: :cascade end