Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table databasechangeloglock
  2. (
  3.     id integer not null
  4.         constraint pk_databasechangeloglock
  5.             primary key,
  6.     locked boolean not null,
  7.     lockgranted timestamp,
  8.     lockedby varchar(255)
  9. );
  10.  
  11. create table databasechangelog
  12. (
  13.     id varchar(255) not null,
  14.     author varchar(255) not null,
  15.     filename varchar(255) not null,
  16.     dateexecuted timestamp not null,
  17.     orderexecuted integer not null,
  18.     exectype varchar(10) not null,
  19.     md5sum varchar(35),
  20.     description varchar(255),
  21.     comments varchar(255),
  22.     tag varchar(255),
  23.     liquibase varchar(20),
  24.     contexts varchar(255),
  25.     labels varchar(255),
  26.     deployment_id varchar(10)
  27. );
  28.  
  29. create table client
  30. (
  31.     id varchar(36) not null
  32.         constraint constraint_7
  33.             primary key,
  34.     enabled boolean default false not null,
  35.     full_scope_allowed boolean default false not null,
  36.     client_id varchar(255),
  37.     not_before integer,
  38.     public_client boolean default false not null,
  39.     secret varchar(255),
  40.     base_url varchar(255),
  41.     bearer_only boolean default false not null,
  42.     management_url varchar(255),
  43.     surrogate_auth_required boolean default false not null,
  44.     realm_id varchar(36),
  45.     protocol varchar(255),
  46.     node_rereg_timeout integer default 0,
  47.     frontchannel_logout boolean default false not null,
  48.     consent_required boolean default false not null,
  49.     name varchar(255),
  50.     service_accounts_enabled boolean default false not null,
  51.     client_authenticator_type varchar(255),
  52.     root_url varchar(255),
  53.     description varchar(255),
  54.     registration_token varchar(255),
  55.     standard_flow_enabled boolean default true not null,
  56.     implicit_flow_enabled boolean default false not null,
  57.     direct_access_grants_enabled boolean default false not null,
  58.     constraint uk_b71cjlbenv945rb6gcon438at
  59.         unique (realm_id, client_id)
  60. );
  61.  
  62. create table event_entity
  63. (
  64.     id varchar(36) not null
  65.         constraint constraint_4
  66.             primary key,
  67.     client_id varchar(255),
  68.     details_json varchar(2550),
  69.     error varchar(255),
  70.     ip_address varchar(255),
  71.     realm_id varchar(255),
  72.     session_id varchar(255),
  73.     event_time bigint,
  74.     type varchar(255),
  75.     user_id varchar(255)
  76. );
  77.  
  78. create table realm
  79. (
  80.     id varchar(36) not null
  81.         constraint constraint_4a
  82.             primary key,
  83.     access_code_lifespan integer,
  84.     user_action_lifespan integer,
  85.     access_token_lifespan integer,
  86.     account_theme varchar(255),
  87.     admin_theme varchar(255),
  88.     email_theme varchar(255),
  89.     enabled boolean default false not null,
  90.     events_enabled boolean default false not null,
  91.     events_expiration bigint,
  92.     login_theme varchar(255),
  93.     name varchar(255)
  94.         constraint uk_orvsdmla56612eaefiq6wl5oi
  95.             unique,
  96.     not_before integer,
  97.     password_policy varchar(2550),
  98.     registration_allowed boolean default false not null,
  99.     remember_me boolean default false not null,
  100.     reset_password_allowed boolean default false not null,
  101.     social boolean default false not null,
  102.     ssl_required varchar(255),
  103.     sso_idle_timeout integer,
  104.     sso_max_lifespan integer,
  105.     update_profile_on_soc_login boolean default false not null,
  106.     verify_email boolean default false not null,
  107.     master_admin_client varchar(36)
  108.         constraint fk_traf444kk6qrkms7n56aiwq5y
  109.             references client,
  110.     login_lifespan integer,
  111.     internationalization_enabled boolean default false not null,
  112.     default_locale varchar(255),
  113.     reg_email_as_username boolean default false not null,
  114.     admin_events_enabled boolean default false not null,
  115.     admin_events_details_enabled boolean default false not null,
  116.     edit_username_allowed boolean default false not null,
  117.     otp_policy_counter integer default 0,
  118.     otp_policy_window integer default 1,
  119.     otp_policy_period integer default 30,
  120.     otp_policy_digits integer default 6,
  121.     otp_policy_alg varchar(36) default 'HmacSHA1'::character varying,
  122.     otp_policy_type varchar(36) default 'totp'::character varying,
  123.     browser_flow varchar(36),
  124.     registration_flow varchar(36),
  125.     direct_grant_flow varchar(36),
  126.     reset_credentials_flow varchar(36),
  127.     client_auth_flow varchar(36),
  128.     offline_session_idle_timeout integer default 0,
  129.     revoke_refresh_token boolean default false not null,
  130.     access_token_life_implicit integer default 0,
  131.     login_with_email_allowed boolean default true not null,
  132.     duplicate_emails_allowed boolean default false not null,
  133.     docker_auth_flow varchar(36),
  134.     refresh_token_max_reuse integer default 0,
  135.     allow_user_managed_access boolean default false not null,
  136.     sso_max_lifespan_remember_me integer default 0 not null,
  137.     sso_idle_timeout_remember_me integer default 0 not null
  138. );
  139.  
  140. alter table client
  141.     add constraint fk_p56ctinxxb9gsk57fo49f9tac
  142.         foreign key (realm_id) references realm;
  143.  
  144. create table keycloak_role
  145. (
  146.     id varchar(36) not null
  147.         constraint constraint_a
  148.             primary key,
  149.     client_realm_constraint varchar(36),
  150.     client_role boolean default false not null,
  151.     description varchar(255),
  152.     name varchar(255),
  153.     realm_id varchar(255),
  154.     client varchar(36)
  155.         constraint fk_kjho5le2c0ral09fl8cm9wfw9
  156.             references client,
  157.     realm varchar(36)
  158.         constraint fk_6vyqfe4cn4wlq8r6kt5vdsj5c
  159.             references realm,
  160.     constraint "UK_J3RWUVD56ONTGSUHOGM184WW2-2"
  161.         unique (name, client_realm_constraint)
  162. );
  163.  
  164. create table client_default_roles
  165. (
  166.     client_id varchar(36) not null
  167.         constraint fk_nuilts7klwqw2h8m2b5joytky
  168.             references client,
  169.     role_id varchar(36) not null
  170.         constraint uk_8aelwnibji49avxsrtuf6xjow
  171.             unique
  172.         constraint fk_8aelwnibji49avxsrtuf6xjow
  173.             references keycloak_role,
  174.     constraint constr_client_default_roles
  175.         primary key (client_id, role_id)
  176. );
  177.  
  178. create index idx_client_def_roles_client
  179.     on client_default_roles (client_id);
  180.  
  181. create table composite_role
  182. (
  183.     composite varchar(36) not null
  184.         constraint fk_a63wvekftu8jo1pnj81e7mce2
  185.             references keycloak_role,
  186.     child_role varchar(36) not null
  187.         constraint fk_gr7thllb9lu8q4vqa4524jjy8
  188.             references keycloak_role,
  189.     constraint constraint_composite_role
  190.         primary key (composite, child_role)
  191. );
  192.  
  193. create index idx_composite
  194.     on composite_role (composite);
  195.  
  196. create index idx_composite_child
  197.     on composite_role (child_role);
  198.  
  199. create index idx_keycloak_role_client
  200.     on keycloak_role (client);
  201.  
  202. create index idx_keycloak_role_realm
  203.     on keycloak_role (realm);
  204.  
  205. create index idx_realm_master_adm_cli
  206.     on realm (master_admin_client);
  207.  
  208. create table realm_attribute
  209. (
  210.     name varchar(255) not null,
  211.     value varchar(255),
  212.     realm_id varchar(36) not null
  213.         constraint fk_8shxd6l3e9atqukacxgpffptw
  214.             references realm,
  215.     constraint constraint_9
  216.         primary key (name, realm_id)
  217. );
  218.  
  219. create index idx_realm_attr_realm
  220.     on realm_attribute (realm_id);
  221.  
  222. create table realm_default_roles
  223. (
  224.     realm_id varchar(36) not null
  225.         constraint fk_evudb1ppw84oxfax2drs03icc
  226.             references realm,
  227.     role_id varchar(36) not null
  228.         constraint uk_h4wpd7w4hsoolni3h0sw7btje
  229.             unique
  230.         constraint fk_h4wpd7w4hsoolni3h0sw7btje
  231.             references keycloak_role,
  232.     constraint constraint_realm_default_roles
  233.         primary key (realm_id, role_id)
  234. );
  235.  
  236. create index idx_realm_def_roles_realm
  237.     on realm_default_roles (realm_id);
  238.  
  239. create table realm_events_listeners
  240. (
  241.     realm_id varchar(36) not null
  242.         constraint fk_h846o4h0w8epx5nxev9f5y69j
  243.             references realm,
  244.     value varchar(255) not null,
  245.     constraint constr_realm_events_listeners
  246.         primary key (realm_id, value)
  247. );
  248.  
  249. create index idx_realm_evt_list_realm
  250.     on realm_events_listeners (realm_id);
  251.  
  252. create table realm_required_credential
  253. (
  254.     type varchar(255) not null,
  255.     form_label varchar(255),
  256.     input boolean default false not null,
  257.     secret boolean default false not null,
  258.     realm_id varchar(36) not null
  259.         constraint fk_5hg65lybevavkqfki3kponh9v
  260.             references realm,
  261.     constraint constraint_92
  262.         primary key (realm_id, type)
  263. );
  264.  
  265. create table realm_smtp_config
  266. (
  267.     realm_id varchar(36) not null
  268.         constraint fk_70ej8xdxgxd0b9hh6180irr0o
  269.             references realm,
  270.     value varchar(255),
  271.     name varchar(255) not null,
  272.     constraint constraint_e
  273.         primary key (realm_id, name)
  274. );
  275.  
  276. create table redirect_uris
  277. (
  278.     client_id varchar(36) not null
  279.         constraint fk_1burs8pb4ouj97h5wuppahv9f
  280.             references client,
  281.     value varchar(255) not null,
  282.     constraint constraint_redirect_uris
  283.         primary key (client_id, value)
  284. );
  285.  
  286. create index idx_redir_uri_client
  287.     on redirect_uris (client_id);
  288.  
  289. create table scope_mapping
  290. (
  291.     client_id varchar(36) not null
  292.         constraint fk_ouse064plmlr732lxjcn1q5f1
  293.             references client,
  294.     role_id varchar(36) not null
  295.         constraint fk_p3rh9grku11kqfrs4fltt7rnq
  296.             references keycloak_role,
  297.     constraint constraint_81
  298.         primary key (client_id, role_id)
  299. );
  300.  
  301. create index idx_scope_mapping_role
  302.     on scope_mapping (role_id);
  303.  
  304. create table username_login_failure
  305. (
  306.     realm_id varchar(36) not null,
  307.     username varchar(255) not null,
  308.     failed_login_not_before integer,
  309.     last_failure bigint,
  310.     last_ip_failure varchar(255),
  311.     num_failures integer,
  312.     constraint "CONSTRAINT_17-2"
  313.         primary key (realm_id, username)
  314. );
  315.  
  316. create table user_entity
  317. (
  318.     id varchar(36) not null
  319.         constraint constraint_fb
  320.             primary key,
  321.     email varchar(255),
  322.     email_constraint varchar(255),
  323.     email_verified boolean default false not null,
  324.     enabled boolean default false not null,
  325.     federation_link varchar(255),
  326.     first_name varchar(255),
  327.     last_name varchar(255),
  328.     realm_id varchar(255),
  329.     username varchar(255),
  330.     created_timestamp bigint,
  331.     service_account_client_link varchar(36),
  332.     not_before integer default 0 not null,
  333.     constraint uk_dykn684sl8up1crfei6eckhd7
  334.         unique (realm_id, email_constraint),
  335.     constraint uk_ru8tt6t700s9v50bu18ws5ha6
  336.         unique (realm_id, username)
  337. );
  338.  
  339. create table credential
  340. (
  341.     id varchar(36) not null
  342.         constraint constraint_f
  343.             primary key,
  344.     salt bytea,
  345.     type varchar(255),
  346.     user_id varchar(36)
  347.         constraint fk_pfyr0glasqyl0dei3kl69r6v0
  348.             references user_entity,
  349.     created_date bigint,
  350.     user_label varchar(255),
  351.     secret_data text,
  352.     credential_data text,
  353.     priority integer
  354. );
  355.  
  356. create index idx_user_credential
  357.     on credential (user_id);
  358.  
  359. create table user_attribute
  360. (
  361.     name varchar(255) not null,
  362.     value varchar(255),
  363.     user_id varchar(36) not null
  364.         constraint fk_5hrm2vlf9ql5fu043kqepovbr
  365.             references user_entity,
  366.     id varchar(36) default 'sybase-needs-something-here'::character varying not null
  367.         constraint constraint_user_attribute_pk
  368.             primary key
  369. );
  370.  
  371. create index idx_user_attribute
  372.     on user_attribute (user_id);
  373.  
  374. create index idx_user_email
  375.     on user_entity (email);
  376.  
  377. create table user_federation_provider
  378. (
  379.     id varchar(36) not null
  380.         constraint constraint_5c
  381.             primary key,
  382.     changed_sync_period integer,
  383.     display_name varchar(255),
  384.     full_sync_period integer,
  385.     last_sync integer,
  386.     priority integer,
  387.     provider_name varchar(255),
  388.     realm_id varchar(36)
  389.         constraint fk_1fj32f6ptolw2qy60cd8n01e8
  390.             references realm
  391. );
  392.  
  393. create table user_federation_config
  394. (
  395.     user_federation_provider_id varchar(36) not null
  396.         constraint fk_t13hpu1j94r2ebpekr39x5eu5
  397.             references user_federation_provider,
  398.     value varchar(255),
  399.     name varchar(255) not null,
  400.     constraint constraint_f9
  401.         primary key (user_federation_provider_id, name)
  402. );
  403.  
  404. create index idx_usr_fed_prv_realm
  405.     on user_federation_provider (realm_id);
  406.  
  407. create table user_required_action
  408. (
  409.     user_id varchar(36) not null
  410.         constraint fk_6qj3w1jw9cvafhe19bwsiuvmd
  411.             references user_entity,
  412.     required_action varchar(255) default ' '::character varying not null,
  413.     constraint constraint_required_action
  414.         primary key (required_action, user_id)
  415. );
  416.  
  417. create index idx_user_reqactions
  418.     on user_required_action (user_id);
  419.  
  420. create table user_role_mapping
  421. (
  422.     role_id varchar(255) not null,
  423.     user_id varchar(36) not null
  424.         constraint fk_c4fqv34p1mbylloxang7b1q3l
  425.             references user_entity,
  426.     constraint constraint_c
  427.         primary key (role_id, user_id)
  428. );
  429.  
  430. create index idx_user_role_mapping
  431.     on user_role_mapping (user_id);
  432.  
  433. create table user_session
  434. (
  435.     id varchar(36) not null
  436.         constraint constraint_57
  437.             primary key,
  438.     auth_method varchar(255),
  439.     ip_address varchar(255),
  440.     last_session_refresh integer,
  441.     login_username varchar(255),
  442.     realm_id varchar(255),
  443.     remember_me boolean default false not null,
  444.     started integer,
  445.     user_id varchar(255),
  446.     user_session_state integer,
  447.     broker_session_id varchar(255),
  448.     broker_user_id varchar(255)
  449. );
  450.  
  451. create table client_session
  452. (
  453.     id varchar(36) not null
  454.         constraint constraint_8
  455.             primary key,
  456.     client_id varchar(36),
  457.     redirect_uri varchar(255),
  458.     state varchar(255),
  459.     timestamp integer,
  460.     session_id varchar(36)
  461.         constraint fk_b4ao2vcvat6ukau74wbwtfqo1
  462.             references user_session,
  463.     auth_method varchar(255),
  464.     realm_id varchar(255),
  465.     auth_user_id varchar(36),
  466.     current_action varchar(36)
  467. );
  468.  
  469. create index idx_client_session_session
  470.     on client_session (session_id);
  471.  
  472. create table client_session_role
  473. (
  474.     role_id varchar(255) not null,
  475.     client_session varchar(36) not null
  476.         constraint fk_11b7sgqw18i532811v7o2dv76
  477.             references client_session,
  478.     constraint constraint_5
  479.         primary key (client_session, role_id)
  480. );
  481.  
  482. create table web_origins
  483. (
  484.     client_id varchar(36) not null
  485.         constraint fk_lojpho213xcx4wnkog82ssrfy
  486.             references client,
  487.     value varchar(255) not null,
  488.     constraint constraint_web_origins
  489.         primary key (client_id, value)
  490. );
  491.  
  492. create index idx_web_orig_client
  493.     on web_origins (client_id);
  494.  
  495. create table client_attributes
  496. (
  497.     client_id varchar(36) not null
  498.         constraint fk3c47c64beacca966
  499.             references client,
  500.     value varchar(4000),
  501.     name varchar(255) not null,
  502.     constraint constraint_3c
  503.         primary key (client_id, name)
  504. );
  505.  
  506. create table client_session_note
  507. (
  508.     name varchar(255) not null,
  509.     value varchar(255),
  510.     client_session varchar(36) not null
  511.         constraint fk5edfb00ff51c2736
  512.             references client_session,
  513.     constraint constraint_5e
  514.         primary key (client_session, name)
  515. );
  516.  
  517. create table client_node_registrations
  518. (
  519.     client_id varchar(36) not null
  520.         constraint fk4129723ba992f594
  521.             references client,
  522.     value integer,
  523.     name varchar(255) not null,
  524.     constraint constraint_84
  525.         primary key (client_id, name)
  526. );
  527.  
  528. create table federated_identity
  529. (
  530.     identity_provider varchar(255) not null,
  531.     realm_id varchar(36),
  532.     federated_user_id varchar(255),
  533.     federated_username varchar(255),
  534.     token text,
  535.     user_id varchar(36) not null
  536.         constraint fk404288b92ef007a6
  537.             references user_entity,
  538.     constraint constraint_40
  539.         primary key (identity_provider, user_id)
  540. );
  541.  
  542. create index idx_fedidentity_user
  543.     on federated_identity (user_id);
  544.  
  545. create index idx_fedidentity_feduser
  546.     on federated_identity (federated_user_id);
  547.  
  548. create table identity_provider
  549. (
  550.     internal_id varchar(36) not null
  551.         constraint constraint_2b
  552.             primary key,
  553.     enabled boolean default false not null,
  554.     provider_alias varchar(255),
  555.     provider_id varchar(255),
  556.     store_token boolean default false not null,
  557.     authenticate_by_default boolean default false not null,
  558.     realm_id varchar(36)
  559.         constraint fk2b4ebc52ae5c3b34
  560.             references realm,
  561.     add_token_role boolean default true not null,
  562.     trust_email boolean default false not null,
  563.     first_broker_login_flow_id varchar(36),
  564.     post_broker_login_flow_id varchar(36),
  565.     provider_display_name varchar(255),
  566.     link_only boolean default false not null,
  567.     constraint uk_2daelwnibji49avxsrtuf6xj33
  568.         unique (provider_alias, realm_id)
  569. );
  570.  
  571. create index idx_ident_prov_realm
  572.     on identity_provider (realm_id);
  573.  
  574. create table identity_provider_config
  575. (
  576.     identity_provider_id varchar(36) not null
  577.         constraint fkdc4897cf864c4e43
  578.             references identity_provider,
  579.     value text,
  580.     name varchar(255) not null,
  581.     constraint constraint_d
  582.         primary key (identity_provider_id, name)
  583. );
  584.  
  585. create table realm_supported_locales
  586. (
  587.     realm_id varchar(36) not null
  588.         constraint fk_supported_locales_realm
  589.             references realm,
  590.     value varchar(255) not null,
  591.     constraint constr_realm_supported_locales
  592.         primary key (realm_id, value)
  593. );
  594.  
  595. create index idx_realm_supp_local_realm
  596.     on realm_supported_locales (realm_id);
  597.  
  598. create table user_session_note
  599. (
  600.     user_session varchar(36) not null
  601.         constraint fk5edfb00ff51d3472
  602.             references user_session,
  603.     name varchar(255) not null,
  604.     value varchar(2048),
  605.     constraint constraint_usn_pk
  606.         primary key (user_session, name)
  607. );
  608.  
  609. create table realm_enabled_event_types
  610. (
  611.     realm_id varchar(36) not null
  612.         constraint fk_h846o4h0w8epx5nwedrf5y69j
  613.             references realm,
  614.     value varchar(255) not null,
  615.     constraint constr_realm_enabl_event_types
  616.         primary key (realm_id, value)
  617. );
  618.  
  619. create index idx_realm_evt_types_realm
  620.     on realm_enabled_event_types (realm_id);
  621.  
  622. create table migration_model
  623. (
  624.     id varchar(36) not null
  625.         constraint constraint_migmod
  626.             primary key,
  627.     version varchar(36),
  628.     update_time bigint default 0 not null
  629. );
  630.  
  631. create index idx_update_time
  632.     on migration_model (update_time);
  633.  
  634. create table identity_provider_mapper
  635. (
  636.     id varchar(36) not null
  637.         constraint constraint_idpm
  638.             primary key,
  639.     name varchar(255) not null,
  640.     idp_alias varchar(255) not null,
  641.     idp_mapper_name varchar(255) not null,
  642.     realm_id varchar(36) not null
  643.         constraint fk_idpm_realm
  644.             references realm
  645. );
  646.  
  647. create index idx_id_prov_mapp_realm
  648.     on identity_provider_mapper (realm_id);
  649.  
  650. create table idp_mapper_config
  651. (
  652.     idp_mapper_id varchar(36) not null
  653.         constraint fk_idpmconfig
  654.             references identity_provider_mapper,
  655.     value text,
  656.     name varchar(255) not null,
  657.     constraint constraint_idpmconfig
  658.         primary key (idp_mapper_id, name)
  659. );
  660.  
  661. create table user_consent
  662. (
  663.     id varchar(36) not null
  664.         constraint constraint_grntcsnt_pm
  665.             primary key,
  666.     client_id varchar(36),
  667.     user_id varchar(36) not null
  668.         constraint fk_grntcsnt_user
  669.             references user_entity,
  670.     created_date bigint,
  671.     last_updated_date bigint,
  672.     client_storage_provider varchar(36),
  673.     external_client_id varchar(255),
  674.     constraint uk_jkuwuvd56ontgsuhogm8uewrt
  675.         unique (client_id, client_storage_provider, external_client_id, user_id)
  676. );
  677.  
  678. create index idx_user_consent
  679.     on user_consent (user_id);
  680.  
  681. create table client_session_prot_mapper
  682. (
  683.     protocol_mapper_id varchar(36) not null,
  684.     client_session varchar(36) not null
  685.         constraint fk_33a8sgqw18i532811v7o2dk89
  686.             references client_session,
  687.     constraint constraint_cs_pmp_pk
  688.         primary key (client_session, protocol_mapper_id)
  689. );
  690.  
  691. create table admin_event_entity
  692. (
  693.     id varchar(36) not null
  694.         constraint constraint_admin_event_entity
  695.             primary key,
  696.     admin_event_time bigint,
  697.     realm_id varchar(255),
  698.     operation_type varchar(255),
  699.     auth_realm_id varchar(255),
  700.     auth_client_id varchar(255),
  701.     auth_user_id varchar(255),
  702.     ip_address varchar(255),
  703.     resource_path varchar(2550),
  704.     representation text,
  705.     error varchar(255),
  706.     resource_type varchar(64)
  707. );
  708.  
  709. create table authenticator_config
  710. (
  711.     id varchar(36) not null
  712.         constraint constraint_auth_pk
  713.             primary key,
  714.     alias varchar(255),
  715.     realm_id varchar(36)
  716.         constraint fk_auth_realm
  717.             references realm
  718. );
  719.  
  720. create index idx_auth_config_realm
  721.     on authenticator_config (realm_id);
  722.  
  723. create table authentication_flow
  724. (
  725.     id varchar(36) not null
  726.         constraint constraint_auth_flow_pk
  727.             primary key,
  728.     alias varchar(255),
  729.     description varchar(255),
  730.     realm_id varchar(36)
  731.         constraint fk_auth_flow_realm
  732.             references realm,
  733.     provider_id varchar(36) default 'basic-flow'::character varying not null,
  734.     top_level boolean default false not null,
  735.     built_in boolean default false not null
  736. );
  737.  
  738. create index idx_auth_flow_realm
  739.     on authentication_flow (realm_id);
  740.  
  741. create table authentication_execution
  742. (
  743.     id varchar(36) not null
  744.         constraint constraint_auth_exec_pk
  745.             primary key,
  746.     alias varchar(255),
  747.     authenticator varchar(36),
  748.     realm_id varchar(36)
  749.         constraint fk_auth_exec_realm
  750.             references realm,
  751.     flow_id varchar(36)
  752.         constraint fk_auth_exec_flow
  753.             references authentication_flow,
  754.     requirement integer,
  755.     priority integer,
  756.     authenticator_flow boolean default false not null,
  757.     auth_flow_id varchar(36),
  758.     auth_config varchar(36)
  759. );
  760.  
  761. create index idx_auth_exec_realm_flow
  762.     on authentication_execution (realm_id, flow_id);
  763.  
  764. create index idx_auth_exec_flow
  765.     on authentication_execution (flow_id);
  766.  
  767. create table authenticator_config_entry
  768. (
  769.     authenticator_id varchar(36) not null,
  770.     value text,
  771.     name varchar(255) not null,
  772.     constraint constraint_auth_cfg_pk
  773.         primary key (authenticator_id, name)
  774. );
  775.  
  776. create table user_federation_mapper
  777. (
  778.     id varchar(36) not null
  779.         constraint constraint_fedmapperpm
  780.             primary key,
  781.     name varchar(255) not null,
  782.     federation_provider_id varchar(36) not null
  783.         constraint fk_fedmapperpm_fedprv
  784.             references user_federation_provider,
  785.     federation_mapper_type varchar(255) not null,
  786.     realm_id varchar(36) not null
  787.         constraint fk_fedmapperpm_realm
  788.             references realm
  789. );
  790.  
  791. create index idx_usr_fed_map_fed_prv
  792.     on user_federation_mapper (federation_provider_id);
  793.  
  794. create index idx_usr_fed_map_realm
  795.     on user_federation_mapper (realm_id);
  796.  
  797. create table user_federation_mapper_config
  798. (
  799.     user_federation_mapper_id varchar(36) not null
  800.         constraint fk_fedmapper_cfg
  801.             references user_federation_mapper,
  802.     value varchar(255),
  803.     name varchar(255) not null,
  804.     constraint constraint_fedmapper_cfg_pm
  805.         primary key (user_federation_mapper_id, name)
  806. );
  807.  
  808. create table client_session_auth_status
  809. (
  810.     authenticator varchar(36) not null,
  811.     status integer,
  812.     client_session varchar(36) not null
  813.         constraint auth_status_constraint
  814.             references client_session,
  815.     constraint constraint_auth_status_pk
  816.         primary key (client_session, authenticator)
  817. );
  818.  
  819. create table client_user_session_note
  820. (
  821.     name varchar(255) not null,
  822.     value varchar(2048),
  823.     client_session varchar(36) not null
  824.         constraint fk_cl_usr_ses_note
  825.             references client_session,
  826.     constraint constr_cl_usr_ses_note
  827.         primary key (client_session, name)
  828. );
  829.  
  830. create table required_action_provider
  831. (
  832.     id varchar(36) not null
  833.         constraint constraint_req_act_prv_pk
  834.             primary key,
  835.     alias varchar(255),
  836.     name varchar(255),
  837.     realm_id varchar(36)
  838.         constraint fk_req_act_realm
  839.             references realm,
  840.     enabled boolean default false not null,
  841.     default_action boolean default false not null,
  842.     provider_id varchar(255),
  843.     priority integer
  844. );
  845.  
  846. create index idx_req_act_prov_realm
  847.     on required_action_provider (realm_id);
  848.  
  849. create table required_action_config
  850. (
  851.     required_action_id varchar(36) not null,
  852.     value text,
  853.     name varchar(255) not null,
  854.     constraint constraint_req_act_cfg_pk
  855.         primary key (required_action_id, name)
  856. );
  857.  
  858. create table offline_user_session
  859. (
  860.     user_session_id varchar(36) not null,
  861.     user_id varchar(255) not null,
  862.     realm_id varchar(36) not null,
  863.     created_on integer not null,
  864.     offline_flag varchar(4) not null,
  865.     data text,
  866.     last_session_refresh integer default 0 not null,
  867.     constraint constraint_offl_us_ses_pk2
  868.         primary key (user_session_id, offline_flag)
  869. );
  870.  
  871. create index idx_offline_uss_createdon
  872.     on offline_user_session (created_on);
  873.  
  874. create table offline_client_session
  875. (
  876.     user_session_id varchar(36) not null,
  877.     client_id varchar(36) not null,
  878.     offline_flag varchar(4) not null,
  879.     timestamp integer,
  880.     data text,
  881.     client_storage_provider varchar(36) default 'local'::character varying not null,
  882.     external_client_id varchar(255) default 'local'::character varying not null,
  883.     constraint constraint_offl_cl_ses_pk3
  884.         primary key (user_session_id, client_id, client_storage_provider, external_client_id, offline_flag)
  885. );
  886.  
  887. create index idx_us_sess_id_on_cl_sess
  888.     on offline_client_session (user_session_id);
  889.  
  890. create table keycloak_group
  891. (
  892.     id varchar(36) not null
  893.         constraint constraint_group
  894.             primary key,
  895.     name varchar(255),
  896.     parent_group varchar(36),
  897.     realm_id varchar(36)
  898.         constraint fk_group_realm
  899.             references realm,
  900.     constraint sibling_names
  901.         unique (realm_id, parent_group, name)
  902. );
  903.  
  904. create table group_role_mapping
  905. (
  906.     role_id varchar(36) not null
  907.         constraint fk_group_role_role
  908.             references keycloak_role,
  909.     group_id varchar(36) not null
  910.         constraint fk_group_role_group
  911.             references keycloak_group,
  912.     constraint constraint_group_role
  913.         primary key (role_id, group_id)
  914. );
  915.  
  916. create index idx_group_role_mapp_group
  917.     on group_role_mapping (group_id);
  918.  
  919. create table group_attribute
  920. (
  921.     id varchar(36) default 'sybase-needs-something-here'::character varying not null
  922.         constraint constraint_group_attribute_pk
  923.             primary key,
  924.     name varchar(255) not null,
  925.     value varchar(255),
  926.     group_id varchar(36) not null
  927.         constraint fk_group_attribute_group
  928.             references keycloak_group
  929. );
  930.  
  931. create index idx_group_attr_group
  932.     on group_attribute (group_id);
  933.  
  934. create table user_group_membership
  935. (
  936.     group_id varchar(36) not null,
  937.     user_id varchar(36) not null
  938.         constraint fk_user_group_user
  939.             references user_entity,
  940.     constraint constraint_user_group
  941.         primary key (group_id, user_id)
  942. );
  943.  
  944. create index idx_user_group_mapping
  945.     on user_group_membership (user_id);
  946.  
  947. create table realm_default_groups
  948. (
  949.     realm_id varchar(36) not null
  950.         constraint fk_def_groups_realm
  951.             references realm,
  952.     group_id varchar(36) not null
  953.         constraint con_group_id_def_groups
  954.             unique
  955.         constraint fk_def_groups_group
  956.             references keycloak_group,
  957.     constraint constr_realm_default_groups
  958.         primary key (realm_id, group_id)
  959. );
  960.  
  961. create index idx_realm_def_grp_realm
  962.     on realm_default_groups (realm_id);
  963.  
  964. create table client_scope
  965. (
  966.     id varchar(36) not null
  967.         constraint pk_cli_template
  968.             primary key,
  969.     name varchar(255),
  970.     realm_id varchar(36)
  971.         constraint fk_realm_cli_scope
  972.             references realm,
  973.     description varchar(255),
  974.     protocol varchar(255),
  975.     constraint uk_cli_scope
  976.         unique (realm_id, name)
  977. );
  978.  
  979. create table protocol_mapper
  980. (
  981.     id varchar(36) not null
  982.         constraint constraint_pcm
  983.             primary key,
  984.     name varchar(255) not null,
  985.     protocol varchar(255) not null,
  986.     protocol_mapper_name varchar(255) not null,
  987.     client_id varchar(36)
  988.         constraint fk_pcm_realm
  989.             references client,
  990.     client_scope_id varchar(36)
  991.         constraint fk_cli_scope_mapper
  992.             references client_scope
  993. );
  994.  
  995. create index idx_protocol_mapper_client
  996.     on protocol_mapper (client_id);
  997.  
  998. create index idx_clscope_protmap
  999.     on protocol_mapper (client_scope_id);
  1000.  
  1001. create table protocol_mapper_config
  1002. (
  1003.     protocol_mapper_id varchar(36) not null
  1004.         constraint fk_pmconfig
  1005.             references protocol_mapper,
  1006.     value text,
  1007.     name varchar(255) not null,
  1008.     constraint constraint_pmconfig
  1009.         primary key (protocol_mapper_id, name)
  1010. );
  1011.  
  1012. create index idx_realm_clscope
  1013.     on client_scope (realm_id);
  1014.  
  1015. create table client_scope_attributes
  1016. (
  1017.     scope_id varchar(36) not null
  1018.         constraint fk_cl_scope_attr_scope
  1019.             references client_scope,
  1020.     value varchar(2048),
  1021.     name varchar(255) not null,
  1022.     constraint pk_cl_tmpl_attr
  1023.         primary key (scope_id, name)
  1024. );
  1025.  
  1026. create index idx_clscope_attrs
  1027.     on client_scope_attributes (scope_id);
  1028.  
  1029. create table client_scope_role_mapping
  1030. (
  1031.     scope_id varchar(36) not null
  1032.         constraint fk_cl_scope_rm_scope
  1033.             references client_scope,
  1034.     role_id varchar(36) not null
  1035.         constraint fk_cl_scope_rm_role
  1036.             references keycloak_role,
  1037.     constraint pk_template_scope
  1038.         primary key (scope_id, role_id)
  1039. );
  1040.  
  1041. create index idx_clscope_role
  1042.     on client_scope_role_mapping (scope_id);
  1043.  
  1044. create index idx_role_clscope
  1045.     on client_scope_role_mapping (role_id);
  1046.  
  1047. create table resource_server
  1048. (
  1049.     id varchar(36) not null
  1050.         constraint pk_resource_server
  1051.             primary key,
  1052.     allow_rs_remote_mgmt boolean default false not null,
  1053.     policy_enforce_mode varchar(15) not null,
  1054.     decision_strategy smallint default 1 not null
  1055. );
  1056.  
  1057. create table resource_server_resource
  1058. (
  1059.     id varchar(36) not null
  1060.         constraint constraint_farsr
  1061.             primary key,
  1062.     name varchar(255) not null,
  1063.     type varchar(255),
  1064.     icon_uri varchar(255),
  1065.     owner varchar(36) not null,
  1066.     resource_server_id varchar(36) not null
  1067.         constraint fk_frsrho213xcx4wnkog82ssrfy
  1068.             references resource_server,
  1069.     owner_managed_access boolean default false not null,
  1070.     display_name varchar(255),
  1071.     constraint uk_frsr6t700s9v50bu18ws5ha6
  1072.         unique (name, owner, resource_server_id)
  1073. );
  1074.  
  1075. create index idx_res_srv_res_res_srv
  1076.     on resource_server_resource (resource_server_id);
  1077.  
  1078. create table resource_server_scope
  1079. (
  1080.     id varchar(36) not null
  1081.         constraint constraint_farsrs
  1082.             primary key,
  1083.     name varchar(255) not null,
  1084.     icon_uri varchar(255),
  1085.     resource_server_id varchar(36) not null
  1086.         constraint fk_frsrso213xcx4wnkog82ssrfy
  1087.             references resource_server,
  1088.     display_name varchar(255),
  1089.     constraint uk_frsrst700s9v50bu18ws5ha6
  1090.         unique (name, resource_server_id)
  1091. );
  1092.  
  1093. create index idx_res_srv_scope_res_srv
  1094.     on resource_server_scope (resource_server_id);
  1095.  
  1096. create table resource_server_policy
  1097. (
  1098.     id varchar(36) not null
  1099.         constraint constraint_farsrp
  1100.             primary key,
  1101.     name varchar(255) not null,
  1102.     description varchar(255),
  1103.     type varchar(255) not null,
  1104.     decision_strategy varchar(20),
  1105.     logic varchar(20),
  1106.     resource_server_id varchar(36) not null
  1107.         constraint fk_frsrpo213xcx4wnkog82ssrfy
  1108.             references resource_server,
  1109.     owner varchar(36),
  1110.     constraint uk_frsrpt700s9v50bu18ws5ha6
  1111.         unique (name, resource_server_id)
  1112. );
  1113.  
  1114. create index idx_res_serv_pol_res_serv
  1115.     on resource_server_policy (resource_server_id);
  1116.  
  1117. create table policy_config
  1118. (
  1119.     policy_id varchar(36) not null
  1120.         constraint fkdc34197cf864c4e43
  1121.             references resource_server_policy,
  1122.     name varchar(255) not null,
  1123.     value text,
  1124.     constraint constraint_dpc
  1125.         primary key (policy_id, name)
  1126. );
  1127.  
  1128. create table resource_scope
  1129. (
  1130.     resource_id varchar(36) not null
  1131.         constraint fk_frsrpos13xcx4wnkog82ssrfy
  1132.             references resource_server_resource,
  1133.     scope_id varchar(36) not null
  1134.         constraint fk_frsrps213xcx4wnkog82ssrfy
  1135.             references resource_server_scope,
  1136.     constraint constraint_farsrsp
  1137.         primary key (resource_id, scope_id)
  1138. );
  1139.  
  1140. create index idx_res_scope_scope
  1141.     on resource_scope (scope_id);
  1142.  
  1143. create table resource_policy
  1144. (
  1145.     resource_id varchar(36) not null
  1146.         constraint fk_frsrpos53xcx4wnkog82ssrfy
  1147.             references resource_server_resource,
  1148.     policy_id varchar(36) not null
  1149.         constraint fk_frsrpp213xcx4wnkog82ssrfy
  1150.             references resource_server_policy,
  1151.     constraint constraint_farsrpp
  1152.         primary key (resource_id, policy_id)
  1153. );
  1154.  
  1155. create index idx_res_policy_policy
  1156.     on resource_policy (policy_id);
  1157.  
  1158. create table scope_policy
  1159. (
  1160.     scope_id varchar(36) not null
  1161.         constraint fk_frsrpass3xcx4wnkog82ssrfy
  1162.             references resource_server_scope,
  1163.     policy_id varchar(36) not null
  1164.         constraint fk_frsrasp13xcx4wnkog82ssrfy
  1165.             references resource_server_policy,
  1166.     constraint constraint_farsrsps
  1167.         primary key (scope_id, policy_id)
  1168. );
  1169.  
  1170. create index idx_scope_policy_policy
  1171.     on scope_policy (policy_id);
  1172.  
  1173. create table associated_policy
  1174. (
  1175.     policy_id varchar(36) not null
  1176.         constraint fk_frsrpas14xcx4wnkog82ssrfy
  1177.             references resource_server_policy,
  1178.     associated_policy_id varchar(36) not null
  1179.         constraint fk_frsr5s213xcx4wnkog82ssrfy
  1180.             references resource_server_policy,
  1181.     constraint constraint_farsrpap
  1182.         primary key (policy_id, associated_policy_id)
  1183. );
  1184.  
  1185. create index idx_assoc_pol_assoc_pol_id
  1186.     on associated_policy (associated_policy_id);
  1187.  
  1188. create table broker_link
  1189. (
  1190.     identity_provider varchar(255) not null,
  1191.     storage_provider_id varchar(255),
  1192.     realm_id varchar(36) not null,
  1193.     broker_user_id varchar(255),
  1194.     broker_username varchar(255),
  1195.     token text,
  1196.     user_id varchar(255) not null,
  1197.     constraint constr_broker_link_pk
  1198.         primary key (identity_provider, user_id)
  1199. );
  1200.  
  1201. create table fed_user_attribute
  1202. (
  1203.     id varchar(36) not null
  1204.         constraint constr_fed_user_attr_pk
  1205.             primary key,
  1206.     name varchar(255) not null,
  1207.     user_id varchar(255) not null,
  1208.     realm_id varchar(36) not null,
  1209.     storage_provider_id varchar(36),
  1210.     value varchar(2024)
  1211. );
  1212.  
  1213. create index idx_fu_attribute
  1214.     on fed_user_attribute (user_id, realm_id, name);
  1215.  
  1216. create table fed_user_consent
  1217. (
  1218.     id varchar(36) not null
  1219.         constraint constr_fed_user_consent_pk
  1220.             primary key,
  1221.     client_id varchar(36),
  1222.     user_id varchar(255) not null,
  1223.     realm_id varchar(36) not null,
  1224.     storage_provider_id varchar(36),
  1225.     created_date bigint,
  1226.     last_updated_date bigint,
  1227.     client_storage_provider varchar(36),
  1228.     external_client_id varchar(255)
  1229. );
  1230.  
  1231. create index idx_fu_consent
  1232.     on fed_user_consent (user_id, client_id);
  1233.  
  1234. create index idx_fu_consent_ru
  1235.     on fed_user_consent (realm_id, user_id);
  1236.  
  1237. create index idx_fu_cnsnt_ext
  1238.     on fed_user_consent (user_id, client_storage_provider, external_client_id);
  1239.  
  1240. create table fed_user_credential
  1241. (
  1242.     id varchar(36) not null
  1243.         constraint constr_fed_user_cred_pk
  1244.             primary key,
  1245.     salt bytea,
  1246.     type varchar(255),
  1247.     created_date bigint,
  1248.     user_id varchar(255) not null,
  1249.     realm_id varchar(36) not null,
  1250.     storage_provider_id varchar(36),
  1251.     user_label varchar(255),
  1252.     secret_data text,
  1253.     credential_data text,
  1254.     priority integer
  1255. );
  1256.  
  1257. create index idx_fu_credential
  1258.     on fed_user_credential (user_id, type);
  1259.  
  1260. create index idx_fu_credential_ru
  1261.     on fed_user_credential (realm_id, user_id);
  1262.  
  1263. create table fed_user_group_membership
  1264. (
  1265.     group_id varchar(36) not null,
  1266.     user_id varchar(255) not null,
  1267.     realm_id varchar(36) not null,
  1268.     storage_provider_id varchar(36),
  1269.     constraint constr_fed_user_group
  1270.         primary key (group_id, user_id)
  1271. );
  1272.  
  1273. create index idx_fu_group_membership
  1274.     on fed_user_group_membership (user_id, group_id);
  1275.  
  1276. create index idx_fu_group_membership_ru
  1277.     on fed_user_group_membership (realm_id, user_id);
  1278.  
  1279. create table fed_user_required_action
  1280. (
  1281.     required_action varchar(255) default ' '::character varying not null,
  1282.     user_id varchar(255) not null,
  1283.     realm_id varchar(36) not null,
  1284.     storage_provider_id varchar(36),
  1285.     constraint constr_fed_required_action
  1286.         primary key (required_action, user_id)
  1287. );
  1288.  
  1289. create index idx_fu_required_action
  1290.     on fed_user_required_action (user_id, required_action);
  1291.  
  1292. create index idx_fu_required_action_ru
  1293.     on fed_user_required_action (realm_id, user_id);
  1294.  
  1295. create table fed_user_role_mapping
  1296. (
  1297.     role_id varchar(36) not null,
  1298.     user_id varchar(255) not null,
  1299.     realm_id varchar(36) not null,
  1300.     storage_provider_id varchar(36),
  1301.     constraint constr_fed_user_role
  1302.         primary key (role_id, user_id)
  1303. );
  1304.  
  1305. create index idx_fu_role_mapping
  1306.     on fed_user_role_mapping (user_id, role_id);
  1307.  
  1308. create index idx_fu_role_mapping_ru
  1309.     on fed_user_role_mapping (realm_id, user_id);
  1310.  
  1311. create table component
  1312. (
  1313.     id varchar(36) not null
  1314.         constraint constr_component_pk
  1315.             primary key,
  1316.     name varchar(255),
  1317.     parent_id varchar(36),
  1318.     provider_id varchar(36),
  1319.     provider_type varchar(255),
  1320.     realm_id varchar(36)
  1321.         constraint fk_component_realm
  1322.             references realm,
  1323.     sub_type varchar(255)
  1324. );
  1325.  
  1326. create table component_config
  1327. (
  1328.     id varchar(36) not null
  1329.         constraint constr_component_config_pk
  1330.             primary key,
  1331.     component_id varchar(36) not null
  1332.         constraint fk_component_config
  1333.             references component,
  1334.     name varchar(255) not null,
  1335.     value varchar(4000)
  1336. );
  1337.  
  1338. create index idx_compo_config_compo
  1339.     on component_config (component_id);
  1340.  
  1341. create index idx_component_realm
  1342.     on component (realm_id);
  1343.  
  1344. create index idx_component_provider_type
  1345.     on component (provider_type);
  1346.  
  1347. create table federated_user
  1348. (
  1349.     id varchar(255) not null
  1350.         constraint constr_federated_user
  1351.             primary key,
  1352.     storage_provider_id varchar(255),
  1353.     realm_id varchar(36) not null
  1354. );
  1355.  
  1356. create table client_initial_access
  1357. (
  1358.     id varchar(36) not null
  1359.         constraint cnstr_client_init_acc_pk
  1360.             primary key,
  1361.     realm_id varchar(36) not null
  1362.         constraint fk_client_init_acc_realm
  1363.             references realm,
  1364.     timestamp integer,
  1365.     expiration integer,
  1366.     count integer,
  1367.     remaining_count integer
  1368. );
  1369.  
  1370. create index idx_client_init_acc_realm
  1371.     on client_initial_access (realm_id);
  1372.  
  1373. create table client_auth_flow_bindings
  1374. (
  1375.     client_id varchar(36) not null,
  1376.     flow_id varchar(36),
  1377.     binding_name varchar(255) not null,
  1378.     constraint c_cli_flow_bind
  1379.         primary key (client_id, binding_name)
  1380. );
  1381.  
  1382. create table client_scope_client
  1383. (
  1384.     client_id varchar(36) not null
  1385.         constraint fk_c_cli_scope_client
  1386.             references client,
  1387.     scope_id varchar(36) not null
  1388.         constraint fk_c_cli_scope_scope
  1389.             references client_scope,
  1390.     default_scope boolean default false not null,
  1391.     constraint c_cli_scope_bind
  1392.         primary key (client_id, scope_id)
  1393. );
  1394.  
  1395. create index idx_clscope_cl
  1396.     on client_scope_client (client_id);
  1397.  
  1398. create index idx_cl_clscope
  1399.     on client_scope_client (scope_id);
  1400.  
  1401. create table default_client_scope
  1402. (
  1403.     realm_id varchar(36) not null
  1404.         constraint fk_r_def_cli_scope_realm
  1405.             references realm,
  1406.     scope_id varchar(36) not null
  1407.         constraint fk_r_def_cli_scope_scope
  1408.             references client_scope,
  1409.     default_scope boolean default false not null,
  1410.     constraint r_def_cli_scope_bind
  1411.         primary key (realm_id, scope_id)
  1412. );
  1413.  
  1414. create index idx_defcls_realm
  1415.     on default_client_scope (realm_id);
  1416.  
  1417. create index idx_defcls_scope
  1418.     on default_client_scope (scope_id);
  1419.  
  1420. create table user_consent_client_scope
  1421. (
  1422.     user_consent_id varchar(36) not null
  1423.         constraint fk_grntcsnt_clsc_usc
  1424.             references user_consent,
  1425.     scope_id varchar(36) not null,
  1426.     constraint constraint_grntcsnt_clsc_pm
  1427.         primary key (user_consent_id, scope_id)
  1428. );
  1429.  
  1430. create index idx_usconsent_clscope
  1431.     on user_consent_client_scope (user_consent_id);
  1432.  
  1433. create table fed_user_consent_cl_scope
  1434. (
  1435.     user_consent_id varchar(36) not null,
  1436.     scope_id varchar(36) not null,
  1437.     constraint constraint_fgrntcsnt_clsc_pm
  1438.         primary key (user_consent_id, scope_id)
  1439. );
  1440.  
  1441. create table resource_server_perm_ticket
  1442. (
  1443.     id varchar(36) not null
  1444.         constraint constraint_fapmt
  1445.             primary key,
  1446.     owner varchar(36) not null,
  1447.     requester varchar(36) not null,
  1448.     created_timestamp bigint not null,
  1449.     granted_timestamp bigint,
  1450.     resource_id varchar(36) not null
  1451.         constraint fk_frsrho213xcx4wnkog83sspmt
  1452.             references resource_server_resource,
  1453.     scope_id varchar(36)
  1454.         constraint fk_frsrho213xcx4wnkog84sspmt
  1455.             references resource_server_scope,
  1456.     resource_server_id varchar(36) not null
  1457.         constraint fk_frsrho213xcx4wnkog82sspmt
  1458.             references resource_server,
  1459.     policy_id varchar(36)
  1460.         constraint fk_frsrpo2128cx4wnkog82ssrfy
  1461.             references resource_server_policy,
  1462.     constraint uk_frsr6t700s9v50bu18ws5pmt
  1463.         unique (owner, requester, resource_server_id, resource_id, scope_id)
  1464. );
  1465.  
  1466. create table resource_attribute
  1467. (
  1468.     id varchar(36) default 'sybase-needs-something-here'::character varying not null
  1469.         constraint res_attr_pk
  1470.             primary key,
  1471.     name varchar(255) not null,
  1472.     value varchar(255),
  1473.     resource_id varchar(36) not null
  1474.         constraint fk_5hrm2vlf9ql5fu022kqepovbr
  1475.             references resource_server_resource
  1476. );
  1477.  
  1478. create table resource_uris
  1479. (
  1480.     resource_id varchar(36) not null
  1481.         constraint fk_resource_server_uris
  1482.             references resource_server_resource,
  1483.     value varchar(255) not null,
  1484.     constraint constraint_resour_uris_pk
  1485.         primary key (resource_id, value)
  1486. );
  1487.  
  1488. create table role_attribute
  1489. (
  1490.     id varchar(36) not null
  1491.         constraint constraint_role_attribute_pk
  1492.             primary key,
  1493.     role_id varchar(36) not null
  1494.         constraint fk_role_attribute_id
  1495.             references keycloak_role,
  1496.     name varchar(255) not null,
  1497.     value varchar(255)
  1498. );
  1499.  
  1500. create index idx_role_attribute
  1501.     on role_attribute (role_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement