122 lines
4.2 KiB
Ruby
Generated
122 lines
4.2 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[8.0].define(version: 2025_06_11_174428) do
|
|
# These are extensions that must be enabled in order to support this database
|
|
enable_extension "pg_catalog.plpgsql"
|
|
enable_extension "pgcrypto"
|
|
|
|
create_table "contacts", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "email"
|
|
t.string "address"
|
|
t.float "geo_long"
|
|
t.float "geo_lat"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
create_table "notes", force: :cascade do |t|
|
|
t.string "title"
|
|
t.text "description"
|
|
t.boolean "pinned"
|
|
t.boolean "archived"
|
|
t.bigint "project_id", null: false
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["project_id"], name: "index_notes_on_project_id"
|
|
end
|
|
|
|
create_table "organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "subdomain"
|
|
t.string "email_domain"
|
|
t.string "logo_url"
|
|
t.string "address"
|
|
t.string "website"
|
|
t.string "phone_number"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["subdomain"], name: "index_organizations_on_subdomain", unique: true
|
|
end
|
|
|
|
create_table "phone_numbers", force: :cascade do |t|
|
|
t.string "phone_number"
|
|
t.integer "type"
|
|
t.bigint "contact_id", null: false
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["contact_id"], name: "index_phone_numbers_on_contact_id"
|
|
end
|
|
|
|
create_table "project_categories", force: :cascade do |t|
|
|
t.string "title"
|
|
t.text "description"
|
|
t.integer "order"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
create_table "projects", force: :cascade do |t|
|
|
t.string "title"
|
|
t.string "website"
|
|
t.string "email"
|
|
t.integer "business_type"
|
|
t.bigint "user_id", null: false
|
|
t.bigint "project_category_id", null: false
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["project_category_id"], name: "index_projects_on_project_category_id"
|
|
t.index ["user_id"], name: "index_projects_on_user_id"
|
|
end
|
|
|
|
create_table "sessions", force: :cascade do |t|
|
|
t.bigint "user_id", null: false
|
|
t.string "ip_address"
|
|
t.string "user_agent"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["user_id"], name: "index_sessions_on_user_id"
|
|
end
|
|
|
|
create_table "tasks", force: :cascade do |t|
|
|
t.string "title"
|
|
t.text "description"
|
|
t.integer "priority"
|
|
t.integer "status"
|
|
t.integer "type"
|
|
t.date "due_date"
|
|
t.bigint "user_id", null: false
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["user_id"], name: "index_tasks_on_user_id"
|
|
end
|
|
|
|
create_table "users", force: :cascade do |t|
|
|
t.string "email_address", null: false
|
|
t.string "password_digest", null: false
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.uuid "organization_id", null: false
|
|
t.index ["email_address"], name: "index_users_on_email_address", unique: true
|
|
t.index ["organization_id"], name: "index_users_on_organization_id"
|
|
end
|
|
|
|
add_foreign_key "notes", "projects"
|
|
add_foreign_key "phone_numbers", "contacts"
|
|
add_foreign_key "projects", "project_categories"
|
|
add_foreign_key "projects", "users"
|
|
add_foreign_key "sessions", "users"
|
|
add_foreign_key "tasks", "users"
|
|
add_foreign_key "users", "organizations"
|
|
end
|