feat: Category API to handle linked categories and parent-sub categories (#4879)
This commit is contained in:
17
db/schema.rb
17
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: 2022_06_22_090344) do
|
||||
ActiveRecord::Schema.define(version: 2022_06_27_135753) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
@@ -197,8 +197,12 @@ ActiveRecord::Schema.define(version: 2022_06_22_090344) do
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.string "locale", default: "en"
|
||||
t.string "slug", null: false
|
||||
t.bigint "parent_category_id"
|
||||
t.bigint "linked_category_id"
|
||||
t.index ["linked_category_id"], name: "index_categories_on_linked_category_id"
|
||||
t.index ["locale", "account_id"], name: "index_categories_on_locale_and_account_id"
|
||||
t.index ["locale"], name: "index_categories_on_locale"
|
||||
t.index ["parent_category_id"], name: "index_categories_on_parent_category_id"
|
||||
t.index ["slug", "locale", "portal_id"], name: "index_categories_on_slug_and_locale_and_portal_id", unique: true
|
||||
end
|
||||
|
||||
@@ -683,6 +687,15 @@ ActiveRecord::Schema.define(version: 2022_06_22_090344) do
|
||||
t.index ["user_id"], name: "index_portals_members_on_user_id"
|
||||
end
|
||||
|
||||
create_table "related_categories", force: :cascade do |t|
|
||||
t.bigint "category_id"
|
||||
t.bigint "related_category_id"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["category_id", "related_category_id"], name: "index_related_categories_on_category_id_and_related_category_id", unique: true
|
||||
t.index ["related_category_id", "category_id"], name: "index_related_categories_on_related_category_id_and_category_id", unique: true
|
||||
end
|
||||
|
||||
create_table "reporting_events", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.float "value"
|
||||
@@ -826,6 +839,8 @@ ActiveRecord::Schema.define(version: 2022_06_22_090344) do
|
||||
add_foreign_key "articles", "users", column: "author_id"
|
||||
add_foreign_key "campaigns", "accounts", on_delete: :cascade
|
||||
add_foreign_key "campaigns", "inboxes", on_delete: :cascade
|
||||
add_foreign_key "categories", "categories", column: "linked_category_id"
|
||||
add_foreign_key "categories", "categories", column: "parent_category_id"
|
||||
add_foreign_key "contact_inboxes", "contacts", on_delete: :cascade
|
||||
add_foreign_key "contact_inboxes", "inboxes", on_delete: :cascade
|
||||
add_foreign_key "conversations", "campaigns", on_delete: :cascade
|
||||
|
||||
Reference in New Issue
Block a user