1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

(feat) Add extra_authorize_params to OpenIdConnect config

This commit is contained in:
Du Peng 2023-09-07 16:22:57 +02:00
parent a72c2e580c
commit e4bd077907
16 changed files with 448 additions and 56 deletions

View File

@ -3,6 +3,7 @@
## next deploy
- improves api/notification controller to avoid failing when there is a notification with wrong notification_type in db
- Add extra_authorize_params to OpenIdConnect config
## v6.0.14 2023 September 6

View File

@ -99,7 +99,7 @@ class API::AuthProvidersController < API::APIController
providable_attributes: [:id, :issuer, :discovery, :client_auth_method, :prompt, :send_scope_to_token_endpoint,
:client__identifier, :client__secret, :client__authorization_endpoint, :client__token_endpoint,
:client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url,
{ scope: [] }],
:extra_authorize_params, { scope: [] }],
auth_provider_mappings_attributes: [:id, :local_model, :local_field, :api_field, :api_endpoint, :api_data_type,
:_destroy, { transformation: [:type, :format, :true_value, :false_value,
{ mapping: %i[from to] }] }])

View File

@ -34,6 +34,15 @@ export const OpenidConnectForm = <TFieldValues extends FieldValues, TContext ext
// this is a workaround for https://github.com/JedWatson/react-select/issues/1879
const [selectKey, setSelectKey] = useState<number>(0);
useEffect(() => {
if (!currentFormValues?.extra_authorize_params) {
setValue(
'providable_attributes.extra_authorize_params' as Path<TFieldValues>,
'{}' as UnpackNestedValue<FieldPathValue<TFieldValues, Path<TFieldValues>>>
);
}
}, []);
// when we have detected a discovery endpoint, we mark it as available
useEffect(() => {
setValue(
@ -160,6 +169,12 @@ export const OpenidConnectForm = <TFieldValues extends FieldValues, TContext ext
tooltip={t('app.admin.authentication.openid_connect_form.profile_edition_url_help')}
rules={{ required: false, pattern: ValidationLib.urlRegex }}
formState={formState} />
<FormInput id="providable_attributes.extra_authorize_params"
register={register}
label={t('app.admin.authentication.openid_connect_form.extra_authorize_params')}
tooltip={t('app.admin.authentication.openid_connect_form.extra_authorize_params_help')}
rules={{ required: false }}
formState={formState} />
<h4>{t('app.admin.authentication.openid_connect_form.client_options')}</h4>
<FormInput id="providable_attributes.client__identifier"
label={t('app.admin.authentication.openid_connect_form.client__identifier')}

View File

@ -61,7 +61,8 @@ export interface OpenIdConnectProvider {
client__userinfo_endpoint?: string,
client__jwks_uri?: string,
client__end_session_endpoint?: string,
profile_url?: string
profile_url?: string,
extra_authorize_parameters?: string,
}
export interface MappingFields {

View File

@ -16,6 +16,6 @@ if @provider.providable_type == OpenIdConnectProvider.name
:prompt, :send_scope_to_token_endpoint, :client__identifier, :client__secret, :client__authorization_endpoint,
:client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url
json.scope @provider.providable[:scope]
json.extra_authorize_params @provider.providable[:extra_authorize_params]
end
end

View File

@ -16,7 +16,7 @@ if provider.providable_type == 'OpenIdConnectProvider'
json.extract! provider.providable, :id, :issuer, :discovery, :client_auth_method, :scope, :response_type, :response_mode,
:display, :prompt, :send_scope_to_token_endpoint, :client__identifier, :client__secret, :client__authorization_endpoint,
:client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url,
:post_logout_redirect_uri, :uid_field, :client__redirect_uri, :client__scheme, :client__host, :client__port
:post_logout_redirect_uri, :uid_field, :client__redirect_uri, :client__scheme, :client__host, :client__port,
:extra_authorize_params
end
end

View File

@ -1477,6 +1477,8 @@ de:
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "End session endpoint"
client__end_session_endpoint_help: "The url to call to log the user out at the authorization server."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Name"
authentication_type: "Authentifizierungsart"

View File

@ -1477,6 +1477,8 @@ en:
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "End session endpoint"
client__end_session_endpoint_help: "The url to call to log the user out at the authorization server."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Name"
authentication_type: "Authentication type"

View File

@ -1477,6 +1477,8 @@ es:
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "Endpoint de fin de sesión"
client__end_session_endpoint_help: "La URL a llamar para cerrar la sesión del usuario en el servidor de autorización."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Nombre"
authentication_type: "Tipo de autenticación"

View File

@ -1477,6 +1477,8 @@ fr:
client__jwks_uri: "URI JWKS"
client__end_session_endpoint: "Point d'accès pour terminer la session"
client__end_session_endpoint_help: "L'url à appeler pour déconnecter l'utilisateur sur le serveur d'autorisation."
extra_authorize_params: "Paramètres d'autorisation supplémentaires"
extra_authorize_params_help: "Un hachage de paramètres supplémentaires fixes qui seront fusionnés à la demande d'autorisation"
provider_form:
name: "Nom"
authentication_type: "Type d'authentification"

View File

@ -1477,6 +1477,8 @@ it:
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "Endpoint di fine sessione"
client__end_session_endpoint_help: "L'url da chiamare per effettuare il log out dell'utente al server di autorizzazione."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Nome"
authentication_type: "Tipo di autenticazione"

View File

@ -1477,6 +1477,8 @@
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "End session endpoint"
client__end_session_endpoint_help: "The url to call to log the user out at the authorization server."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Name"
authentication_type: "Authentication type"

View File

@ -1477,6 +1477,8 @@ pt:
client__jwks_uri: "JWKS URI"
client__end_session_endpoint: "Endpoint de término de sessão"
client__end_session_endpoint_help: "O Url para efetuar uma chamada para desconectar o usuário no servidor de autorização."
extra_authorize_params: "Extra authorize parameters"
extra_authorize_params_help: "A hash of extra fixed parameters that will be merged to the authorization request"
provider_form:
name: "Nome"
authentication_type: "Tipo de autenticação"

View File

@ -1477,6 +1477,8 @@ zu:
client__jwks_uri: "crwdns26198:0crwdne26198:0"
client__end_session_endpoint: "crwdns26200:0crwdne26200:0"
client__end_session_endpoint_help: "crwdns26202:0crwdne26202:0"
extra_authorize_params: "crwdns37725:0crwdne37725:0"
extra_authorize_params_help: "crwdns37727:0crwdne37727:0"
provider_form:
name: "crwdns26204:0crwdne26204:0"
authentication_type: "crwdns26206:0crwdne26206:0"

View File

@ -0,0 +1,5 @@
class AddExtraAuthorizeParamsToOpenIdConnectProvider < ActiveRecord::Migration[7.0]
def change
add_column :open_id_connect_providers, :extra_authorize_params, :jsonb, default: {}
end
end

View File

@ -9,6 +9,13 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: -
--
-- *not* creating schema, since initdb creates it
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
@ -108,8 +115,8 @@ SET default_tablespace = '';
CREATE TABLE public.abuses (
id integer NOT NULL,
signaled_id integer,
signaled_type character varying,
signaled_id integer,
first_name character varying,
last_name character varying,
email character varying,
@ -229,8 +236,8 @@ CREATE TABLE public.addresses (
locality character varying,
country character varying,
postal_code character varying,
placeable_id integer,
placeable_type character varying,
placeable_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
@ -339,8 +346,8 @@ CREATE TABLE public.ar_internal_metadata (
CREATE TABLE public.assets (
id integer NOT NULL,
viewable_id integer,
viewable_type character varying,
viewable_id integer,
attachment character varying,
type character varying,
created_at timestamp without time zone,
@ -513,6 +520,41 @@ CREATE SEQUENCE public.availability_tags_id_seq
ALTER SEQUENCE public.availability_tags_id_seq OWNED BY public.availability_tags.id;
--
-- Name: booking_users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.booking_users (
id bigint NOT NULL,
name character varying,
reservation_id bigint,
booked_type character varying,
booked_id bigint,
event_price_category_id bigint,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: booking_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.booking_users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: booking_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.booking_users_id_seq OWNED BY public.booking_users.id;
--
-- Name: cart_item_coupons; Type: TABLE; Schema: public; Owner: -
--
@ -546,6 +588,41 @@ CREATE SEQUENCE public.cart_item_coupons_id_seq
ALTER SEQUENCE public.cart_item_coupons_id_seq OWNED BY public.cart_item_coupons.id;
--
-- Name: cart_item_event_reservation_booking_users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.cart_item_event_reservation_booking_users (
id bigint NOT NULL,
name character varying,
cart_item_event_reservation_id bigint,
event_price_category_id bigint,
booked_type character varying,
booked_id bigint,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: cart_item_event_reservation_booking_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.cart_item_event_reservation_booking_users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: cart_item_event_reservation_booking_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.cart_item_event_reservation_booking_users_id_seq OWNED BY public.cart_item_event_reservation_booking_users.id;
--
-- Name: cart_item_event_reservation_tickets; Type: TABLE; Schema: public; Owner: -
--
@ -886,6 +963,43 @@ CREATE SEQUENCE public.chained_elements_id_seq
ALTER SEQUENCE public.chained_elements_id_seq OWNED BY public.chained_elements.id;
--
-- Name: children; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.children (
id bigint NOT NULL,
user_id bigint,
first_name character varying,
last_name character varying,
birthday date,
phone character varying,
email character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
validated_at timestamp(6) without time zone
);
--
-- Name: children_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.children_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: children_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.children_id_seq OWNED BY public.children.id;
--
-- Name: components; Type: TABLE; Schema: public; Owner: -
--
@ -959,8 +1073,8 @@ ALTER SEQUENCE public.coupons_id_seq OWNED BY public.coupons.id;
CREATE TABLE public.credits (
id integer NOT NULL,
creditable_id integer,
creditable_type character varying,
creditable_id integer,
plan_id integer,
hours integer,
created_at timestamp without time zone,
@ -1130,7 +1244,10 @@ CREATE TABLE public.events (
recurrence_id integer,
age_range_id integer,
category_id integer,
deleted_at timestamp without time zone
deleted_at timestamp without time zone,
event_type character varying DEFAULT 'standard'::character varying,
pre_registration boolean DEFAULT false,
pre_registration_end_date timestamp(6) without time zone
);
@ -1619,7 +1736,8 @@ CREATE TABLE public.machines (
disabled boolean,
deleted_at timestamp without time zone,
machine_category_id bigint,
reservable boolean DEFAULT true
reservable boolean DEFAULT true,
space_id bigint
);
@ -1757,15 +1875,15 @@ ALTER SEQUENCE public.notification_types_id_seq OWNED BY public.notification_typ
CREATE TABLE public.notifications (
id integer NOT NULL,
receiver_id integer,
attached_object_id integer,
attached_object_type character varying,
attached_object_id integer,
notification_type_id integer,
is_read boolean DEFAULT false,
created_at timestamp without time zone,
updated_at timestamp without time zone,
receiver_type character varying,
is_send boolean DEFAULT false,
meta_data jsonb DEFAULT '{}'::jsonb
meta_data jsonb DEFAULT '"{}"'::jsonb
);
@ -1921,7 +2039,8 @@ CREATE TABLE public.open_id_connect_providers (
client__end_session_endpoint character varying,
profile_url character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
updated_at timestamp without time zone NOT NULL,
extra_authorize_params jsonb DEFAULT '{}'::jsonb
);
@ -2123,6 +2242,41 @@ CREATE SEQUENCE public.payment_gateway_objects_id_seq
ALTER SEQUENCE public.payment_gateway_objects_id_seq OWNED BY public.payment_gateway_objects.id;
--
-- Name: payment_infos; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.payment_infos (
id bigint NOT NULL,
data jsonb,
state character varying,
payment_for character varying,
service character varying,
statistic_profile_id bigint,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: payment_infos_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.payment_infos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: payment_infos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.payment_infos_id_seq OWNED BY public.payment_infos.id;
--
-- Name: payment_schedule_items; Type: TABLE; Schema: public; Owner: -
--
@ -2493,8 +2647,8 @@ CREATE TABLE public.prices (
id integer NOT NULL,
group_id integer,
plan_id integer,
priceable_id integer,
priceable_type character varying,
priceable_id integer,
amount integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
@ -3052,8 +3206,8 @@ CREATE TABLE public.reservations (
message text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
reservable_id integer,
reservable_type character varying,
reservable_id integer,
nb_reserve_places integer,
statistic_profile_id integer,
reservation_context_id bigint
@ -3086,8 +3240,8 @@ ALTER SEQUENCE public.reservations_id_seq OWNED BY public.reservations.id;
CREATE TABLE public.roles (
id integer NOT NULL,
name character varying,
resource_id integer,
resource_type character varying,
resource_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
@ -3197,7 +3351,9 @@ CREATE TABLE public.slots_reservations (
ex_start_at timestamp without time zone,
ex_end_at timestamp without time zone,
canceled_at timestamp without time zone,
offered boolean DEFAULT false
offered boolean DEFAULT false,
is_valid boolean,
is_confirm boolean
);
@ -3234,7 +3390,9 @@ CREATE TABLE public.spaces (
updated_at timestamp without time zone NOT NULL,
characteristics text,
disabled boolean,
deleted_at timestamp without time zone
deleted_at timestamp without time zone,
ancestry character varying NOT NULL COLLATE pg_catalog."C",
ancestry_depth integer DEFAULT 0
);
@ -3730,10 +3888,11 @@ ALTER SEQUENCE public.subscriptions_id_seq OWNED BY public.subscriptions.id;
CREATE TABLE public.supporting_document_files (
id bigint NOT NULL,
supporting_document_type_id bigint,
user_id bigint,
supportable_id bigint,
attachment character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
updated_at timestamp without time zone NOT NULL,
supportable_type character varying DEFAULT 'User'::character varying
);
@ -3762,11 +3921,12 @@ ALTER SEQUENCE public.supporting_document_files_id_seq OWNED BY public.supportin
CREATE TABLE public.supporting_document_refusals (
id bigint NOT NULL,
user_id bigint,
supportable_id bigint,
operator_id integer,
message text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
updated_at timestamp without time zone NOT NULL,
supportable_type character varying DEFAULT 'User'::character varying
);
@ -3807,7 +3967,8 @@ CREATE TABLE public.supporting_document_types (
id bigint NOT NULL,
name character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
updated_at timestamp without time zone NOT NULL,
document_type character varying DEFAULT 'User'::character varying
);
@ -4193,8 +4354,8 @@ CREATE TABLE public.users (
is_allow_newsletter boolean,
current_sign_in_ip inet,
last_sign_in_ip inet,
mapped_from_sso character varying,
validated_at timestamp without time zone
validated_at timestamp without time zone,
mapped_from_sso character varying
);
@ -4403,6 +4564,13 @@ ALTER TABLE ONLY public.availabilities ALTER COLUMN id SET DEFAULT nextval('publ
ALTER TABLE ONLY public.availability_tags ALTER COLUMN id SET DEFAULT nextval('public.availability_tags_id_seq'::regclass);
--
-- Name: booking_users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.booking_users ALTER COLUMN id SET DEFAULT nextval('public.booking_users_id_seq'::regclass);
--
-- Name: cart_item_coupons id; Type: DEFAULT; Schema: public; Owner: -
--
@ -4410,6 +4578,13 @@ ALTER TABLE ONLY public.availability_tags ALTER COLUMN id SET DEFAULT nextval('p
ALTER TABLE ONLY public.cart_item_coupons ALTER COLUMN id SET DEFAULT nextval('public.cart_item_coupons_id_seq'::regclass);
--
-- Name: cart_item_event_reservation_booking_users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.cart_item_event_reservation_booking_users ALTER COLUMN id SET DEFAULT nextval('public.cart_item_event_reservation_booking_users_id_seq'::regclass);
--
-- Name: cart_item_event_reservation_tickets id; Type: DEFAULT; Schema: public; Owner: -
--
@ -4480,6 +4655,13 @@ ALTER TABLE ONLY public.categories ALTER COLUMN id SET DEFAULT nextval('public.c
ALTER TABLE ONLY public.chained_elements ALTER COLUMN id SET DEFAULT nextval('public.chained_elements_id_seq'::regclass);
--
-- Name: children id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.children ALTER COLUMN id SET DEFAULT nextval('public.children_id_seq'::regclass);
--
-- Name: components id; Type: DEFAULT; Schema: public; Owner: -
--
@ -4725,6 +4907,13 @@ ALTER TABLE ONLY public.organizations ALTER COLUMN id SET DEFAULT nextval('publi
ALTER TABLE ONLY public.payment_gateway_objects ALTER COLUMN id SET DEFAULT nextval('public.payment_gateway_objects_id_seq'::regclass);
--
-- Name: payment_infos id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.payment_infos ALTER COLUMN id SET DEFAULT nextval('public.payment_infos_id_seq'::regclass);
--
-- Name: payment_schedule_items id; Type: DEFAULT; Schema: public; Owner: -
--
@ -5262,6 +5451,14 @@ ALTER TABLE ONLY public.availability_tags
ADD CONSTRAINT availability_tags_pkey PRIMARY KEY (id);
--
-- Name: booking_users booking_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.booking_users
ADD CONSTRAINT booking_users_pkey PRIMARY KEY (id);
--
-- Name: cart_item_coupons cart_item_coupons_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -5270,6 +5467,14 @@ ALTER TABLE ONLY public.cart_item_coupons
ADD CONSTRAINT cart_item_coupons_pkey PRIMARY KEY (id);
--
-- Name: cart_item_event_reservation_booking_users cart_item_event_reservation_booking_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.cart_item_event_reservation_booking_users
ADD CONSTRAINT cart_item_event_reservation_booking_users_pkey PRIMARY KEY (id);
--
-- Name: cart_item_event_reservation_tickets cart_item_event_reservation_tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -5350,6 +5555,14 @@ ALTER TABLE ONLY public.chained_elements
ADD CONSTRAINT chained_elements_pkey PRIMARY KEY (id);
--
-- Name: children children_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.children
ADD CONSTRAINT children_pkey PRIMARY KEY (id);
--
-- Name: components components_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -5630,6 +5843,14 @@ ALTER TABLE ONLY public.payment_gateway_objects
ADD CONSTRAINT payment_gateway_objects_pkey PRIMARY KEY (id);
--
-- Name: payment_infos payment_infos_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.payment_infos
ADD CONSTRAINT payment_infos_pkey PRIMARY KEY (id);
--
-- Name: payment_schedule_items payment_schedule_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -5854,6 +6075,14 @@ ALTER TABLE ONLY public.roles
ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
--
-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -6204,6 +6433,41 @@ CREATE INDEX index_availability_tags_on_availability_id ON public.availability_t
CREATE INDEX index_availability_tags_on_tag_id ON public.availability_tags USING btree (tag_id);
--
-- Name: index_booking_users_on_booked; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_booking_users_on_booked ON public.booking_users USING btree (booked_type, booked_id);
--
-- Name: index_booking_users_on_event_price_category_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_booking_users_on_event_price_category_id ON public.booking_users USING btree (event_price_category_id);
--
-- Name: index_booking_users_on_reservation_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_booking_users_on_reservation_id ON public.booking_users USING btree (reservation_id);
--
-- Name: index_cart_item_booking_users_on_cart_item_event_reservation; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_cart_item_booking_users_on_cart_item_event_reservation ON public.cart_item_event_reservation_booking_users USING btree (cart_item_event_reservation_id);
--
-- Name: index_cart_item_booking_users_on_event_price_category; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_cart_item_booking_users_on_event_price_category ON public.cart_item_event_reservation_booking_users USING btree (event_price_category_id);
--
-- Name: index_cart_item_coupons_on_coupon_id; Type: INDEX; Schema: public; Owner: -
--
@ -6225,6 +6489,13 @@ CREATE INDEX index_cart_item_coupons_on_customer_profile_id ON public.cart_item_
CREATE INDEX index_cart_item_coupons_on_operator_profile_id ON public.cart_item_coupons USING btree (operator_profile_id);
--
-- Name: index_cart_item_event_reservation_booking_users_on_booked; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_cart_item_event_reservation_booking_users_on_booked ON public.cart_item_event_reservation_booking_users USING btree (booked_type, booked_id);
--
-- Name: index_cart_item_event_reservations_on_customer_profile_id; Type: INDEX; Schema: public; Owner: -
--
@ -6393,6 +6664,13 @@ CREATE UNIQUE INDEX index_categories_on_slug ON public.categories USING btree (s
CREATE INDEX index_chained_elements_on_element ON public.chained_elements USING btree (element_type, element_id);
--
-- Name: index_children_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_children_on_user_id ON public.children USING btree (user_id);
--
-- Name: index_coupons_on_code; Type: INDEX; Schema: public; Owner: -
--
@ -6631,6 +6909,13 @@ CREATE INDEX index_machines_on_machine_category_id ON public.machines USING btre
CREATE UNIQUE INDEX index_machines_on_slug ON public.machines USING btree (slug);
--
-- Name: index_machines_on_space_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_machines_on_space_id ON public.machines USING btree (space_id);
--
-- Name: index_notification_preferences_on_notification_type_id; Type: INDEX; Schema: public; Owner: -
--
@ -6771,6 +7056,13 @@ CREATE INDEX index_payment_gateway_objects_on_item_type_and_item_id ON public.pa
CREATE INDEX index_payment_gateway_objects_on_payment_gateway_object_id ON public.payment_gateway_objects USING btree (payment_gateway_object_id);
--
-- Name: index_payment_infos_on_statistic_profile_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_payment_infos_on_statistic_profile_id ON public.payment_infos USING btree (statistic_profile_id);
--
-- Name: index_payment_schedule_items_on_invoice_id; Type: INDEX; Schema: public; Owner: -
--
@ -7177,6 +7469,13 @@ CREATE INDEX index_spaces_availabilities_on_availability_id ON public.spaces_ava
CREATE INDEX index_spaces_availabilities_on_space_id ON public.spaces_availabilities USING btree (space_id);
--
-- Name: index_spaces_on_ancestry; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_spaces_on_ancestry ON public.spaces USING btree (ancestry);
--
-- Name: index_spaces_on_deleted_at; Type: INDEX; Schema: public; Owner: -
--
@ -7289,6 +7588,13 @@ CREATE INDEX index_subscriptions_on_plan_id ON public.subscriptions USING btree
CREATE INDEX index_subscriptions_on_statistic_profile_id ON public.subscriptions USING btree (statistic_profile_id);
--
-- Name: index_supporting_document_files_on_supportable_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_supporting_document_files_on_supportable_id ON public.supporting_document_files USING btree (supportable_id);
--
-- Name: index_supporting_document_files_on_supporting_document_type_id; Type: INDEX; Schema: public; Owner: -
--
@ -7297,17 +7603,10 @@ CREATE INDEX index_supporting_document_files_on_supporting_document_type_id ON p
--
-- Name: index_supporting_document_files_on_user_id; Type: INDEX; Schema: public; Owner: -
-- Name: index_supporting_document_refusals_on_supportable_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_supporting_document_files_on_user_id ON public.supporting_document_files USING btree (user_id);
--
-- Name: index_supporting_document_refusals_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_supporting_document_refusals_on_user_id ON public.supporting_document_refusals USING btree (user_id);
CREATE INDEX index_supporting_document_refusals_on_supportable_id ON public.supporting_document_refusals USING btree (supportable_id);
--
@ -7555,21 +7854,6 @@ CREATE INDEX proof_of_identity_type_id_and_proof_of_identity_refusal_id ON publi
CREATE UNIQUE INDEX unique_not_null_external_id ON public.invoicing_profiles USING btree (external_id) WHERE (external_id IS NOT NULL);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
--
-- Name: accounting_periods accounting_periods_del_protect; Type: RULE; Schema: public; Owner: -
--
CREATE RULE accounting_periods_del_protect AS
ON DELETE TO public.accounting_periods DO INSTEAD NOTHING;
--
-- Name: accounting_periods accounting_periods_upd_protect; Type: RULE; Schema: public; Owner: -
--
@ -7603,6 +7887,22 @@ ALTER TABLE ONLY public.payment_schedules
ADD CONSTRAINT fk_rails_00308dc223 FOREIGN KEY (wallet_transaction_id) REFERENCES public.wallet_transactions(id);
--
-- Name: payment_infos fk_rails_0308366a58; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.payment_infos
ADD CONSTRAINT fk_rails_0308366a58 FOREIGN KEY (statistic_profile_id) REFERENCES public.statistic_profiles(id);
--
-- Name: cart_item_event_reservation_booking_users fk_rails_0964335a37; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.cart_item_event_reservation_booking_users
ADD CONSTRAINT fk_rails_0964335a37 FOREIGN KEY (event_price_category_id) REFERENCES public.event_price_categories(id);
--
-- Name: cart_item_free_extensions fk_rails_0d11862969; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -7803,6 +8103,14 @@ ALTER TABLE ONLY public.subscriptions
ADD CONSTRAINT fk_rails_358a71f738 FOREIGN KEY (statistic_profile_id) REFERENCES public.statistic_profiles(id);
--
-- Name: booking_users fk_rails_38ad1ae7e8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.booking_users
ADD CONSTRAINT fk_rails_38ad1ae7e8 FOREIGN KEY (reservation_id) REFERENCES public.reservations(id);
--
-- Name: invoices fk_rails_40d78f8cf6; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -7867,6 +8175,14 @@ ALTER TABLE ONLY public.chained_elements
ADD CONSTRAINT fk_rails_4fad806cca FOREIGN KEY (previous_id) REFERENCES public.chained_elements(id);
--
-- Name: cart_item_event_reservation_booking_users fk_rails_5206c6ca4a; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.cart_item_event_reservation_booking_users
ADD CONSTRAINT fk_rails_5206c6ca4a FOREIGN KEY (cart_item_event_reservation_id) REFERENCES public.cart_item_event_reservations(id);
--
-- Name: cart_item_event_reservation_tickets fk_rails_5307e8aab8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -8104,7 +8420,7 @@ ALTER TABLE ONLY public.orders
--
ALTER TABLE ONLY public.supporting_document_refusals
ADD CONSTRAINT fk_rails_91d424352e FOREIGN KEY (user_id) REFERENCES public.users(id);
ADD CONSTRAINT fk_rails_91d424352e FOREIGN KEY (supportable_id) REFERENCES public.users(id);
--
@ -8203,6 +8519,14 @@ ALTER TABLE ONLY public.cart_item_coupons
ADD CONSTRAINT fk_rails_a44bac1e45 FOREIGN KEY (operator_profile_id) REFERENCES public.invoicing_profiles(id);
--
-- Name: children fk_rails_a51d7cfb22; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.children
ADD CONSTRAINT fk_rails_a51d7cfb22 FOREIGN KEY (user_id) REFERENCES public.users(id);
--
-- Name: projects_themes fk_rails_b021a22658; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -8219,6 +8543,14 @@ ALTER TABLE ONLY public.statistic_profile_prepaid_packs
ADD CONSTRAINT fk_rails_b0251cdfcf FOREIGN KEY (prepaid_pack_id) REFERENCES public.prepaid_packs(id);
--
-- Name: machines fk_rails_b2e37688bb; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.machines
ADD CONSTRAINT fk_rails_b2e37688bb FOREIGN KEY (space_id) REFERENCES public.spaces(id);
--
-- Name: orders fk_rails_b33ed6c672; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -8467,6 +8799,14 @@ ALTER TABLE ONLY public.projects
ADD CONSTRAINT fk_rails_e812590204 FOREIGN KEY (author_statistic_profile_id) REFERENCES public.statistic_profiles(id);
--
-- Name: booking_users fk_rails_e88263229e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.booking_users
ADD CONSTRAINT fk_rails_e88263229e FOREIGN KEY (event_price_category_id) REFERENCES public.event_price_categories(id);
--
-- Name: user_tags fk_rails_ea0382482a; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -8578,7 +8918,6 @@ INSERT INTO "schema_migrations" (version) VALUES
('20140605125131'),
('20140605142133'),
('20140605151442'),
('20140606133116'),
('20140609092700'),
('20140609092827'),
('20140610153123'),
@ -8647,14 +8986,12 @@ INSERT INTO "schema_migrations" (version) VALUES
('20150507075620'),
('20150512123546'),
('20150520132030'),
('20150520133409'),
('20150526130729'),
('20150527153312'),
('20150529113555'),
('20150601125944'),
('20150603104502'),
('20150603104658'),
('20150603133050'),
('20150604081757'),
('20150604131525'),
('20150608142234'),
@ -8736,7 +9073,6 @@ INSERT INTO "schema_migrations" (version) VALUES
('20160905142700'),
('20160906094739'),
('20160906094847'),
('20160906145713'),
('20160915105234'),
('20161123104604'),
('20170109085345'),
@ -8904,11 +9240,29 @@ INSERT INTO "schema_migrations" (version) VALUES
('20230328094807'),
('20230328094808'),
('20230328094809'),
('20230331132506'),
('20230509121907'),
('20230509161557'),
('20230510141305'),
('20230511080650'),
('20230511081018'),
('20230524080448'),
('20230524083558'),
('20230524110215'),
('20230525101006'),
('20230612123250'),
('20230626103314'),
('20230626122844'),
('20230626122947'),
('20230710072403'),
('20230718133636'),
('20230718134350'),
('20230720085857'),
('20230828073428');
('20230728072726'),
('20230728090257'),
('20230825101952'),
('20230828073428'),
('20230831103208'),
('20230907124230');