# encoding: UTF-8
# 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.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20240417092355) do

  create_table "admin_users", :force => true do |t|
    t.string "name",            :null => false
    t.string "password_digest", :null => false
  end

  add_index "admin_users", ["name"], :name => "index_admin_users_on_name", :unique => true

  create_table "banners", :force => true do |t|
    t.string   "uri",                             :null => false
    t.text     "body"
    t.boolean  "published",    :default => false, :null => false
    t.datetime "published_at",                    :null => false
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
  end

  create_table "catalogue_categories", :force => true do |t|
    t.string   "title",                         :null => false
    t.text     "description"
    t.text     "body"
    t.integer  "parent_id"
    t.integer  "sort_order",  :default => 0
    t.boolean  "published",   :default => true, :null => false
    t.datetime "created_at",                    :null => false
    t.datetime "updated_at",                    :null => false
  end

  create_table "catalogue_category_hierarchies", :id => false, :force => true do |t|
    t.integer "ancestor_id",   :null => false
    t.integer "descendant_id", :null => false
    t.integer "generations",   :null => false
  end

  add_index "catalogue_category_hierarchies", ["ancestor_id", "descendant_id"], :name => "index_cch_on_a_id_and_d_id", :unique => true
  add_index "catalogue_category_hierarchies", ["descendant_id"], :name => "index_cch_on_d_id"

  create_table "certificate_images", :force => true do |t|
    t.string   "uri",            :null => false
    t.integer  "certificate_id"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "certificate_images", ["certificate_id"], :name => "index_certificate_images_on_certificate_id"

  create_table "certificates", :force => true do |t|
    t.string   "title",                          :null => false
    t.text     "description",                    :null => false
    t.boolean  "published",   :default => false, :null => false
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
  end

  create_table "company_infos", :force => true do |t|
    t.text     "body_about"
    t.text     "body_manufacturing"
    t.text     "body_contacts"
    t.string   "info_phone"
    t.string   "info_email"
    t.string   "info_tagline"
    t.text     "info_contacts"
    t.string   "en_title"
    t.text     "en_body"
    t.datetime "created_at",         :null => false
    t.datetime "updated_at",         :null => false
    t.text     "history"
  end

  create_table "manufacturers", :force => true do |t|
    t.boolean  "published",    :default => false, :null => false
    t.string   "title",                           :null => false
    t.text     "description"
    t.text     "body"
    t.boolean  "partner",      :default => false, :null => false
    t.string   "logotype_uri"
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
  end

  create_table "med_items", :force => true do |t|
    t.string   "title",                           :null => false
    t.text     "description",                     :null => false
    t.text     "body",                            :null => false
    t.boolean  "published",    :default => false, :null => false
    t.datetime "published_at",                    :null => false
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
  end

  create_table "news_items", :force => true do |t|
    t.string   "title",                           :null => false
    t.text     "description",                     :null => false
    t.text     "body",                            :null => false
    t.boolean  "published",    :default => false, :null => false
    t.datetime "published_at",                    :null => false
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
  end

  create_table "orders", :force => true do |t|
    t.string   "customer_name"
    t.string   "customer_contact"
    t.text     "comment"
    t.boolean  "ordered",          :default => false, :null => false
    t.boolean  "processed",        :default => false, :null => false
    t.datetime "created_at",                          :null => false
    t.datetime "updated_at",                          :null => false
  end

  create_table "orders_products", :id => false, :force => true do |t|
    t.integer "order_id",   :null => false
    t.integer "product_id", :null => false
  end

  add_index "orders_products", ["order_id", "product_id"], :name => "index_orders_products_on_order_id_and_product_id"

  create_table "product_documents", :force => true do |t|
    t.string   "title",      :null => false
    t.string   "uri",        :null => false
    t.integer  "product_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "product_documents", ["product_id"], :name => "index_product_documents_on_product_id"

  create_table "product_images", :force => true do |t|
    t.string   "title",      :null => false
    t.string   "uri",        :null => false
    t.integer  "product_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "product_images", ["product_id"], :name => "index_product_images_on_product_id"

  create_table "products", :force => true do |t|
    t.string   "title",                                   :null => false
    t.string   "code"
    t.string   "main_image_uri"
    t.text     "body"
    t.text     "specifications"
    t.integer  "manufacturer_id",                         :null => false
    t.integer  "catalogue_category_id",                   :null => false
    t.boolean  "published"
    t.boolean  "delta",                 :default => true, :null => false
    t.datetime "created_at",                              :null => false
    t.datetime "updated_at",                              :null => false
  end

  add_index "products", ["catalogue_category_id"], :name => "index_products_on_catalogue_category_id"
  add_index "products", ["manufacturer_id"], :name => "index_products_on_manufacturer_id"

  create_table "products_relations", :id => false, :force => true do |t|
    t.integer "product_id"
    t.integer "related_product_id"
  end

  add_index "products_relations", ["product_id", "related_product_id"], :name => "index_products_relations_on_product_id_and_related_product_id"

  create_table "projects", :force => true do |t|
    t.string   "title",                           :null => false
    t.text     "description",                     :null => false
    t.text     "body",                            :null => false
    t.date     "completed_at"
    t.boolean  "published",    :default => false, :null => false
    t.string   "customer"
    t.datetime "created_at",                      :null => false
    t.datetime "updated_at",                      :null => false
  end

end
