Skip to content

Commit

Permalink
Changed schema
Browse files Browse the repository at this point in the history
  • Loading branch information
KseniaGovorun committed Dec 1, 2024
1 parent c00152f commit 31c5f50
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_11_30_191031) do
ActiveRecord::Schema[7.2].define(version: 2024_10_31_011638) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -44,26 +44,26 @@
end

create_table "calculators", force: :cascade do |t|
t.uuid "uuid", default: -> { "gen_random_uuid()" }, null: false
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "slug"
t.string "uk_name", default: "", null: false
t.string "en_name", default: "", null: false
t.boolean "preferable", default: false, null: false
t.index ["name"], name: "index_calculators_on_name", unique: true
t.index ["slug"], name: "index_calculators_on_slug", unique: true
t.index ["uuid"], name: "index_calculators_on_uuid", unique: true
end

create_table "categories", force: :cascade do |t|
t.string "uk_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "priority", default: 0, null: false
t.string "en_name"
t.decimal "price", precision: 10, scale: 2, default: "0.0", null: false
t.bigint "field_id"
t.boolean "preferable", default: false, null: false
t.index ["en_name"], name: "index_categories_on_en_name", unique: true
t.index ["field_id"], name: "index_categories_on_field_id"
t.index ["uk_name"], name: "index_categories_on_uk_name", unique: true
t.string "en_name"
t.index "lower((en_name)::text)", name: "index_categories_on_en_name", unique: true
t.index "lower((uk_name)::text)", name: "index_categories_on_uk_name", unique: true
end

create_table "category_categoryables", force: :cascade do |t|
Expand Down Expand Up @@ -97,15 +97,21 @@
end

create_table "fields", force: :cascade do |t|
t.string "kind", null: false
t.uuid "uuid", default: -> { "gen_random_uuid()" }, null: false
t.bigint "calculator_id", null: false
t.string "selector", null: false
t.string "type", null: false
t.string "label"
t.string "name"
t.string "value"
t.integer "from"
t.integer "to"
t.integer "kind", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "unit", default: 0
t.string "uk_label", default: "", null: false
t.string "en_label", default: "", null: false
t.string "var_name", default: "", null: false
t.bigint "calculator_id", null: false
t.index ["calculator_id"], name: "index_fields_on_calculator_id"
t.index ["uuid"], name: "index_fields_on_uuid", unique: true
end

create_table "flipper_features", force: :cascade do |t|
Expand All @@ -126,19 +132,6 @@
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
end

create_table "formulas", force: :cascade do |t|
t.string "expression", default: "", null: false
t.string "uk_label", default: "", null: false
t.string "en_label", default: "", null: false
t.string "uk_unit"
t.string "en_unit"
t.bigint "calculator_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "priority", default: 0, null: false
t.index ["calculator_id"], name: "index_formulas_on_calculator_id"
end

create_table "messages", force: :cascade do |t|
t.string "title", null: false
t.string "message", null: false
Expand Down Expand Up @@ -229,9 +222,6 @@

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 "categories", "fields"
add_foreign_key "category_categoryables", "categories"
add_foreign_key "diapers_periods", "categories"
add_foreign_key "fields", "calculators"
add_foreign_key "formulas", "calculators"
end

0 comments on commit 31c5f50

Please sign in to comment.