feat: Macros CRUD api (#5047)
This commit is contained in:
14
db/migrate/20220711090528_create_macros.rb
Normal file
14
db/migrate/20220711090528_create_macros.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateMacros < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :macros do |t|
|
||||
t.bigint :account_id, null: false
|
||||
t.string :name, null: false
|
||||
t.integer :visibility, default: 0
|
||||
t.references :created_by, null: false, index: true, foreign_key: { to_table: :users }
|
||||
t.references :updated_by, null: false, index: true, foreign_key: { to_table: :users }
|
||||
t.jsonb :actions, null: false, default: '{}'
|
||||
t.timestamps
|
||||
t.index :account_id, name: 'index_macros_on_account_id'
|
||||
end
|
||||
end
|
||||
end
|
||||
16
db/schema.rb
16
db/schema.rb
@@ -563,6 +563,20 @@ ActiveRecord::Schema.define(version: 2022_07_18_123938) do
|
||||
t.index ["title", "account_id"], name: "index_labels_on_title_and_account_id", unique: true
|
||||
end
|
||||
|
||||
create_table "macros", force: :cascade do |t|
|
||||
t.bigint "account_id", null: false
|
||||
t.string "name", null: false
|
||||
t.integer "visibility", default: 0
|
||||
t.bigint "created_by_id", null: false
|
||||
t.bigint "updated_by_id", null: false
|
||||
t.jsonb "actions", default: "{}", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["account_id"], name: "index_macros_on_account_id"
|
||||
t.index ["created_by_id"], name: "index_macros_on_created_by_id"
|
||||
t.index ["updated_by_id"], name: "index_macros_on_updated_by_id"
|
||||
end
|
||||
|
||||
create_table "mentions", force: :cascade do |t|
|
||||
t.bigint "user_id", null: false
|
||||
t.bigint "conversation_id", null: false
|
||||
@@ -869,6 +883,8 @@ ActiveRecord::Schema.define(version: 2022_07_18_123938) do
|
||||
add_foreign_key "dashboard_apps", "accounts"
|
||||
add_foreign_key "dashboard_apps", "users"
|
||||
add_foreign_key "data_imports", "accounts", on_delete: :cascade
|
||||
add_foreign_key "macros", "users", column: "created_by_id"
|
||||
add_foreign_key "macros", "users", column: "updated_by_id"
|
||||
add_foreign_key "mentions", "conversations", on_delete: :cascade
|
||||
add_foreign_key "mentions", "users", on_delete: :cascade
|
||||
add_foreign_key "notes", "accounts", on_delete: :cascade
|
||||
|
||||
Reference in New Issue
Block a user