mirror of https://github.com/docusealco/docuseal
parent
c9af371bc0
commit
53d0dee930
@ -0,0 +1,22 @@
|
|||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: export_locations
|
||||||
|
#
|
||||||
|
# id :bigint not null, primary key
|
||||||
|
# api_base_url :string not null
|
||||||
|
# authorization_token :string
|
||||||
|
# default_location :boolean default(FALSE), not null
|
||||||
|
# extra_params :jsonb not null
|
||||||
|
# name :string not null
|
||||||
|
# templates_endpoint :string
|
||||||
|
# created_at :datetime not null
|
||||||
|
# updated_at :datetime not null
|
||||||
|
#
|
||||||
|
class ExportLocation < ApplicationRecord
|
||||||
|
validates :name, presence: true
|
||||||
|
validates :api_base_url, presence: true
|
||||||
|
|
||||||
|
def self.default_location
|
||||||
|
where(default_location: true).first || ExportLocation.first
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
class CreateExportLocations < ActiveRecord::Migration[8.0]
|
||||||
|
def change
|
||||||
|
create_table :export_locations do |t|
|
||||||
|
t.string :name, null: false
|
||||||
|
t.boolean :default_location, null: false, default: false
|
||||||
|
t.string :authorization_token
|
||||||
|
t.string :api_base_url, null: false
|
||||||
|
# t.string extra_params, null: false, default: '{}'
|
||||||
|
t.string :templates_endpoint
|
||||||
|
# t.string other_export_type_endpoints_maybe_one_day
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
class AddAuthParamsToExportLocations < ActiveRecord::Migration[8.0]
|
||||||
|
def change
|
||||||
|
add_column :export_locations, :extra_params, :jsonb, null: false, default: {}
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in new issue