Feature: Knowledge Base APIs (#1002)
- Introduce models & migrations for portals, categories, folders and articles - CRUD API for portals - CRUD API for categories Addresses: #714 Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
17
db/migrate/20200704135408_create_kbase_portals.rb
Normal file
17
db/migrate/20200704135408_create_kbase_portals.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateKbasePortals < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :kbase_portals do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.string :name, null: false
|
||||
t.string :slug, null: false
|
||||
t.string :custom_domain
|
||||
t.string :color
|
||||
t.string :homepage_link
|
||||
t.string :page_title
|
||||
t.text :header_text
|
||||
|
||||
t.index :slug, unique: true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
13
db/migrate/20200704135810_create_kbase_categories.rb
Normal file
13
db/migrate/20200704135810_create_kbase_categories.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateKbaseCategories < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :kbase_categories do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.integer :portal_id, null: false
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.integer :position
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20200704140029_create_kbase_folders.rb
Normal file
11
db/migrate/20200704140029_create_kbase_folders.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateKbaseFolders < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :kbase_folders do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.integer :category_id, null: false
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
18
db/migrate/20200704140509_create_kbase_articles.rb
Normal file
18
db/migrate/20200704140509_create_kbase_articles.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class CreateKbaseArticles < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :kbase_articles do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.integer :portal_id, null: false
|
||||
t.integer :category_id
|
||||
t.integer :folder_id
|
||||
t.integer :author_id
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.text :content
|
||||
t.integer :status
|
||||
t.integer :views
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
47
db/schema.rb
47
db/schema.rb
@@ -300,6 +300,53 @@ ActiveRecord::Schema.define(version: 2020_09_07_094912) do
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
create_table "kbase_articles", force: :cascade do |t|
|
||||
t.integer "account_id", null: false
|
||||
t.integer "portal_id", null: false
|
||||
t.integer "category_id"
|
||||
t.integer "folder_id"
|
||||
t.integer "author_id"
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.text "content"
|
||||
t.integer "status"
|
||||
t.integer "views"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
create_table "kbase_categories", force: :cascade do |t|
|
||||
t.integer "account_id", null: false
|
||||
t.integer "portal_id", null: false
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.integer "position"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
create_table "kbase_folders", force: :cascade do |t|
|
||||
t.integer "account_id", null: false
|
||||
t.integer "category_id", null: false
|
||||
t.string "name"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
create_table "kbase_portals", force: :cascade do |t|
|
||||
t.integer "account_id", null: false
|
||||
t.string "name", null: false
|
||||
t.string "slug", null: false
|
||||
t.string "custom_domain"
|
||||
t.string "color"
|
||||
t.string "homepage_link"
|
||||
t.string "page_title"
|
||||
t.text "header_text"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["slug"], name: "index_kbase_portals_on_slug", unique: true
|
||||
end
|
||||
|
||||
create_table "labels", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
|
||||
Reference in New Issue
Block a user