From 8f691b566ffbc79f1d2d7a3f67d8607cc03a789c Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 8 Oct 2020 16:51:30 +0200 Subject: Add model foundation for classifications Taxonomy > Category > Section This commit adds models for it. https://doc.incommon.cc/#classifications --- db/schema.rb | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index fbd0924..5a8bba7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_10_06_140511) do +ActiveRecord::Schema.define(version: 2020_10_08_133300) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -35,6 +35,19 @@ ActiveRecord::Schema.define(version: 2020_10_06_140511) do t.index ["uuid"], name: "index_agents_on_uuid", unique: true end + create_table "categories", force: :cascade do |t| + t.string "name", limit: 64 + t.string "summary", limit: 136 + t.text "description" + t.bigint "taxonomy_id", null: false + t.string "color", limit: 25 + t.integer "rank" + t.integer "sections_count", default: 0 + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["taxonomy_id"], name: "index_categories_on_taxonomy_id" + end + create_table "resources", force: :cascade do |t| t.uuid "uuid" t.jsonb "feature" @@ -45,6 +58,32 @@ ActiveRecord::Schema.define(version: 2020_10_06_140511) do t.index ["uuid"], name: "index_resources_on_uuid", unique: true end + create_table "sections", force: :cascade do |t| + t.string "name", limit: 64 + t.string "summary", limit: 136 + t.text "description" + t.bigint "category_id", null: false + t.string "color", limit: 25 + t.integer "rank", default: 0 + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["category_id"], name: "index_sections_on_category_id" + end + + create_table "taxonomies", force: :cascade do |t| + t.string "name", limit: 64 + t.string "summary", limit: 64 + t.text "description" + t.uuid "uuid" + t.integer "categories_count", default: 0 + t.bigint "agent_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["agent_id"], name: "index_taxonomies_on_agent_id" + t.index ["name"], name: "index_taxonomies_on_name", unique: true + t.index ["uuid"], name: "index_taxonomies_on_uuid", unique: true + end + create_table "users", force: :cascade do |t| t.string "name" t.string "username" @@ -59,5 +98,8 @@ ActiveRecord::Schema.define(version: 2020_10_06_140511) do add_foreign_key "agencies", "agents" add_foreign_key "agencies", "users" + add_foreign_key "categories", "taxonomies" add_foreign_key "resources", "agents" + add_foreign_key "sections", "categories" + add_foreign_key "taxonomies", "agents" end -- cgit v1.2.3