115 lines
4.5 KiB
Ruby
Generated
115 lines
4.5 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.define(version: 2021_09_17_144722) do
|
|
|
|
create_table "active_admin_comments", force: :cascade do |t|
|
|
t.string "namespace"
|
|
t.text "body"
|
|
t.string "resource_type"
|
|
t.integer "resource_id"
|
|
t.string "author_type"
|
|
t.integer "author_id"
|
|
t.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author"
|
|
t.index ["namespace"], name: "index_active_admin_comments_on_namespace"
|
|
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource"
|
|
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.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
t.index ["email"], name: "index_admin_users_on_email", unique: true
|
|
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
|
end
|
|
|
|
create_table "employers", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "logo_url"
|
|
t.string "short_name"
|
|
t.string "short_code"
|
|
t.integer "users_count", default: 0
|
|
t.integer "subscriptions_count", default: 0
|
|
t.string "status"
|
|
t.boolean "user_set_status", default: false
|
|
t.bigint "primary_contact_id"
|
|
t.integer "savings_report_frequency_in_months", default: 3, null: false
|
|
t.date "first_joined_at"
|
|
t.string "org_type", default: "member", null: false
|
|
t.bigint "asana_assignee_id"
|
|
t.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
t.index ["asana_assignee_id"], name: "index_employers_on_asana_assignee_id"
|
|
t.index ["first_joined_at"], name: "index_employers_on_first_joined_at"
|
|
t.index ["org_type"], name: "index_employers_on_org_type"
|
|
t.index ["primary_contact_id"], name: "index_employers_on_primary_contact_id"
|
|
end
|
|
|
|
create_table "products", force: :cascade do |t|
|
|
t.string "name"
|
|
t.bigint "industry_id"
|
|
t.bigint "supplier_id"
|
|
t.string "description"
|
|
t.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
end
|
|
|
|
create_table "subscriptions", force: :cascade do |t|
|
|
t.string "contact"
|
|
t.integer "licenses_count"
|
|
t.string "name"
|
|
t.string "supplier_name"
|
|
t.string "industry_name"
|
|
t.string "product_name"
|
|
t.integer "licese_type"
|
|
t.integer "max_users"
|
|
t.date "starts_at"
|
|
t.date "ends_at"
|
|
t.integer "active_licenses_count"
|
|
t.text "notes"
|
|
t.boolean "is_autorenew"
|
|
t.integer "autorenew_duration"
|
|
t.string "autorenew_duration_unit", default: "month", null: false
|
|
t.string "duration_unit", default: "month", null: false
|
|
t.date "autorenew_deadline"
|
|
t.string "billing_frequency"
|
|
t.string "contract_entity_name"
|
|
t.date "autorenew_voided_at"
|
|
t.date "renewed_at"
|
|
t.decimal "retention", precision: 17, scale: 2
|
|
t.string "limit"
|
|
t.integer "retention_currency_id"
|
|
t.boolean "has_percentage_discount_type"
|
|
t.boolean "has_flat_fare_discount_type"
|
|
t.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
t.integer "employer_id", null: false
|
|
t.integer "series_successor_id"
|
|
t.date "terminated_at"
|
|
t.index ["employer_id"], name: "index_subscriptions_on_employer_id"
|
|
end
|
|
|
|
create_table "suppliers", force: :cascade do |t|
|
|
t.string "name"
|
|
t.datetime "created_at", precision: 6, null: false
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
end
|
|
|
|
add_foreign_key "subscriptions", "employers"
|
|
end
|