add template application key

pull/109/head
DocuSeal 2 years ago
parent 036f6049a2
commit 14c3c8181b

@ -8,6 +8,7 @@ module Api
templates = Templates.search(@templates, params[:q])
templates = params[:archived] ? templates.archived : templates.active
templates = templates.where(application_key: params[:application_key]) if params[:application_key].present?
templates = paginate(templates.preload(:author, documents_attachments: :blob))

@ -4,19 +4,20 @@
#
# Table name: templates
#
# id :bigint not null, primary key
# deleted_at :datetime
# fields :text not null
# name :string not null
# schema :text not null
# slug :string not null
# source :text not null
# submitters :text not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# author_id :bigint not null
# folder_id :bigint not null
# id :bigint not null, primary key
# application_key :string
# deleted_at :datetime
# fields :text not null
# name :string not null
# schema :text not null
# slug :string not null
# source :text not null
# submitters :text not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# author_id :bigint not null
# folder_id :bigint not null
#
# Indexes
#

@ -1,6 +1,6 @@
# frozen_string_literal: true
class AddApplicationIdToSubmitters < ActiveRecord::Migration[7.0]
class AddApplicationKeyToSubmitters < ActiveRecord::Migration[7.0]
def change
add_column :submitters, :application_key, :string
end

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddApplicationKeyToTemplates < ActiveRecord::Migration[7.0]
def change
add_column :templates, :application_key, :string
end
end

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_10_17_213639) do
ActiveRecord::Schema[7.0].define(version: 2023_11_02_171817) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -173,6 +173,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_17_213639) do
t.datetime "updated_at", null: false
t.text "source", null: false
t.bigint "folder_id", null: false
t.string "application_key"
t.index ["account_id"], name: "index_templates_on_account_id"
t.index ["author_id"], name: "index_templates_on_author_id"
t.index ["folder_id"], name: "index_templates_on_folder_id"

Loading…
Cancel
Save