improved API key handling
This commit is contained in:
@ -3,17 +3,17 @@
|
||||
CAUTION: Do not modify this file unless you know what you are doing.
|
||||
Unexpected results may occur if the code is changed deliberately.
|
||||
-->
|
||||
<dbmodel pgmodeler-ver="0.9.1" author="Joern Muehlencord" last-position="46,0" last-zoom="0.6"
|
||||
default-schema="public">
|
||||
<dbmodel pgmodeler-ver="0.9.2-beta" last-position="0,0" last-zoom="0.9" max-obj-count="13"
|
||||
default-owner="postgres">
|
||||
<database name="account_test" encoding="UTF8" lc-collate="C" lc-ctype="C" is-template="false" allow-conns="true" sql-disabled="true">
|
||||
</database>
|
||||
|
||||
<schema name="public" fill-color="#e1e1e1" sql-disabled="true">
|
||||
<schema name="public" layer="0" fill-color="#e1e1e1" sql-disabled="true">
|
||||
</schema>
|
||||
|
||||
<table name="config" hide-ext-attribs="true">
|
||||
<table name="config" layer="0" collapse-mode="1" max-obj-count="6">
|
||||
<schema name="public"/>
|
||||
<position x="1655" y="520"/>
|
||||
<position x="1480" y="220"/>
|
||||
<column name="application" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -34,9 +34,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application_role" hide-ext-attribs="true">
|
||||
<table name="application_role" layer="0" collapse-mode="1" max-obj-count="4">
|
||||
<schema name="public"/>
|
||||
<position x="5" y="450"/>
|
||||
<position x="100" y="260"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -57,9 +57,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account" hide-ext-attribs="true">
|
||||
<table name="account" layer="0" collapse-mode="1" max-obj-count="12">
|
||||
<schema name="public"/>
|
||||
<position x="1020" y="795"/>
|
||||
<position x="1080" y="460"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -98,9 +98,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account_history" hide-ext-attribs="true">
|
||||
<table name="account_history" layer="0" collapse-mode="1" max-obj-count="8">
|
||||
<schema name="public"/>
|
||||
<position x="230" y="930"/>
|
||||
<position x="180" y="640"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -127,9 +127,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account_role" hide-ext-attribs="true">
|
||||
<table name="account_role" layer="0" collapse-mode="1" max-obj-count="3">
|
||||
<schema name="public"/>
|
||||
<position x="540" y="620"/>
|
||||
<position x="480" y="440"/>
|
||||
<column name="account" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -141,9 +141,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application_permission" hide-ext-attribs="true">
|
||||
<table name="application_permission" layer="0" collapse-mode="1" max-obj-count="4">
|
||||
<schema name="public"/>
|
||||
<position x="1290" y="180"/>
|
||||
<position x="1080" y="100"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -164,9 +164,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="role_permission" hide-ext-attribs="true">
|
||||
<table name="role_permission" layer="0" collapse-mode="1" max-obj-count="3">
|
||||
<schema name="public"/>
|
||||
<position x="585" y="165"/>
|
||||
<position x="560" y="80"/>
|
||||
<column name="application_role" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -178,9 +178,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="mail_template" hide-ext-attribs="true">
|
||||
<table name="mail_template" layer="0" collapse-mode="1" max-obj-count="2">
|
||||
<schema name="public"/>
|
||||
<position x="290" y="1235"/>
|
||||
<position x="120" y="940"/>
|
||||
<column name="template_name" not-null="true">
|
||||
<type name="character varying" length="40"/>
|
||||
</column>
|
||||
@ -192,9 +192,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application" hide-ext-attribs="true">
|
||||
<table name="application" layer="0" collapse-mode="1" max-obj-count="2">
|
||||
<schema name="public"/>
|
||||
<position x="840" y="415"/>
|
||||
<position x="720" y="320"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -210,9 +210,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
<schema name="public"/>
|
||||
</extension>
|
||||
|
||||
<table name="account_login" hide-ext-attribs="true">
|
||||
<table name="account_login" layer="0" collapse-mode="1" max-obj-count="15">
|
||||
<schema name="public"/>
|
||||
<position x="1670" y="755"/>
|
||||
<position x="1520" y="680"/>
|
||||
<column name="id" not-null="true" default-value="uuid_generate_v4()">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -260,9 +260,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="api_key">
|
||||
<table name="api_key" layer="0" collapse-mode="1" max-obj-count="7">
|
||||
<schema name="public"/>
|
||||
<position x="1612.5" y="1057.5"/>
|
||||
<position x="680" y="760"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
@ -278,6 +278,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
<column name="expiration">
|
||||
<type name="smallint" length="0"/>
|
||||
</column>
|
||||
<column name="expires_on" not-null="true">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<constraint name="api_key_pk" type="pk-constr" table="public.api_key">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
@ -349,62 +352,57 @@ CAUTION: Do not modify this file unless you know what you are doing.
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<relationship name="rel_account_history_account" type="relfk"
|
||||
custom-color="#83af1f"
|
||||
src-table="public.account_history"
|
||||
dst-table="public.account" reference-fk="fk_account_history_username_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_account" type="relfk"
|
||||
custom-color="#5aa578"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.account" reference-fk="fk_account_role_account"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_application_role" type="relfk"
|
||||
custom-color="#4b3e56"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.application_role" reference-fk="fk_account_role_role_name"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_role" type="relfk"
|
||||
custom-color="#9ac721"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_role" reference-fk="fk_role_permission_application_role"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_permission" type="relfk"
|
||||
custom-color="#249b49"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_permission" reference-fk="fk_role_permission_role_permission"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_config_account" type="relfk"
|
||||
<relationship name="rel_config_account" type="relfk" layer="0"
|
||||
src-table="public.config"
|
||||
dst-table="public.account" reference-fk="config_key_account_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_application_role_application" type="relfk"
|
||||
src-table="public.application_role"
|
||||
dst-table="public.application" reference-fk="application_role_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_application_permission_application" type="relfk"
|
||||
src-table="public.application_permission"
|
||||
dst-table="public.application" reference-fk="application_permission_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_login_account" type="relfk"
|
||||
src-table="public.account_login"
|
||||
dst-table="public.account" reference-fk="account_login_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_config_application" type="relfk"
|
||||
<relationship name="rel_config_application" type="relfk" layer="0"
|
||||
src-table="public.config"
|
||||
dst-table="public.application" reference-fk="config_application_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_api_key_account" type="relfk"
|
||||
<relationship name="rel_application_role_application" type="relfk" layer="0"
|
||||
src-table="public.application_role"
|
||||
dst-table="public.application" reference-fk="application_role_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_history_account" type="relfk" layer="0"
|
||||
src-table="public.account_history"
|
||||
dst-table="public.account" reference-fk="fk_account_history_username_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_account" type="relfk" layer="0"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.account" reference-fk="fk_account_role_account"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_application_role" type="relfk" layer="0"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.application_role" reference-fk="fk_account_role_role_name"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_application_permission_application" type="relfk" layer="0"
|
||||
src-table="public.application_permission"
|
||||
dst-table="public.application" reference-fk="application_permission_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_role" type="relfk" layer="0"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_role" reference-fk="fk_role_permission_application_role"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_permission" type="relfk" layer="0"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_permission" reference-fk="fk_role_permission_role_permission"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_login_account" type="relfk" layer="0"
|
||||
src-table="public.account_login"
|
||||
dst-table="public.account" reference-fk="account_login_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_api_key_account" type="relfk" layer="0"
|
||||
src-table="public.api_key"
|
||||
dst-table="public.account" reference-fk="api_key_account_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
407
account/sql/account_fixed.dbm
Normal file
407
account/sql/account_fixed.dbm
Normal file
@ -0,0 +1,407 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
CAUTION: Do not modify this file unless you know what you are doing.
|
||||
Unexpected results may occur if the code is changed deliberately.
|
||||
-->
|
||||
<dbmodel pgmodeler-ver="0.9.2-beta" last-position="0,0" last-zoom="1" max-obj-count="13"
|
||||
default-owner="postgres">
|
||||
<database name="account_test" encoding="UTF8" lc-collate="C" lc-ctype="C" is-template="false" allow-conns="true" sql-disabled="true">
|
||||
</database>
|
||||
|
||||
<schema name="public" layer="0" fill-color="#e1e1e1" sql-disabled="true">
|
||||
</schema>
|
||||
|
||||
<table name="config" layer="0" collapse-mode="2" max-obj-count="6">
|
||||
<schema name="public"/>
|
||||
<position x="1655" y="520"/>
|
||||
<column name="application" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="config_key" not-null="true">
|
||||
<type name="varchar" length="100"/>
|
||||
</column>
|
||||
<column name="config_key_account" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="config_key_group">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<column name="config_value">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<constraint name="config_pk" type="pk-constr" table="public.config">
|
||||
<columns names="application,config_key,config_key_account" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application_role" layer="0" collapse-mode="2" max-obj-count="4">
|
||||
<schema name="public"/>
|
||||
<position x="5" y="450"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="application" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="role_name" not-null="true">
|
||||
<type name="character varying" length="80"/>
|
||||
</column>
|
||||
<column name="role_description" not-null="true">
|
||||
<type name="character varying" length="200"/>
|
||||
</column>
|
||||
<constraint name="application_role_pk" type="pk-constr" table="public.application_role">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
<constraint name="application_role_name_uidx" type="uq-constr" table="public.application_role">
|
||||
<columns names="application,role_name" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account" layer="0" collapse-mode="2" max-obj-count="12">
|
||||
<schema name="public"/>
|
||||
<position x="1020" y="795"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="username" not-null="true">
|
||||
<type name="character varying" length="32"/>
|
||||
</column>
|
||||
<column name="emailaddress" not-null="true">
|
||||
<type name="character varying" length="200"/>
|
||||
</column>
|
||||
<column name="firstname" not-null="true">
|
||||
<type name="character varying" length="100"/>
|
||||
</column>
|
||||
<column name="lastname" not-null="true">
|
||||
<type name="character varying" length="100"/>
|
||||
</column>
|
||||
<column name="status" not-null="true" default-value="'NEW'">
|
||||
<type name="character varying" length="10"/>
|
||||
</column>
|
||||
<column name="created_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamp with time zone" length="0" with-timezone="true"/>
|
||||
</column>
|
||||
<column name="created_by" not-null="true">
|
||||
<type name="character varying" length="32"/>
|
||||
</column>
|
||||
<column name="last_updated_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamp with time zone" length="0" with-timezone="true"/>
|
||||
</column>
|
||||
<column name="last_updated_by" not-null="true">
|
||||
<type name="character varying" length="32"/>
|
||||
</column>
|
||||
<constraint name="pk_account" type="pk-constr" table="public.account">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
<constraint name="uidx_username" type="uq-constr" table="public.account">
|
||||
<columns names="username" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account_history" layer="0" collapse-mode="2" max-obj-count="8">
|
||||
<schema name="public"/>
|
||||
<position x="230" y="930"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="account_id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="message">
|
||||
<type name="character varying" length="200"/>
|
||||
</column>
|
||||
<column name="failure_count" not-null="true" default-value="0">
|
||||
<type name="integer" length="0"/>
|
||||
</column>
|
||||
<column name="status" not-null="true">
|
||||
<type name="character varying" length="20"/>
|
||||
</column>
|
||||
<column name="last_updated_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamp with time zone" length="0" with-timezone="true"/>
|
||||
</column>
|
||||
<column name="last_updated_by" not-null="true">
|
||||
<type name="character varying" length="32"/>
|
||||
</column>
|
||||
<constraint name="pk_account_history" type="pk-constr" table="public.account_history">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="account_role" layer="0" collapse-mode="2" max-obj-count="3">
|
||||
<schema name="public"/>
|
||||
<position x="540" y="620"/>
|
||||
<column name="account" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="account_role" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<constraint name="pk_account_role" type="pk-constr" table="public.account_role">
|
||||
<columns names="account,account_role" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application_permission" layer="0" collapse-mode="2" max-obj-count="4">
|
||||
<schema name="public"/>
|
||||
<position x="1290" y="180"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="application" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="permission_name" not-null="true">
|
||||
<type name="character varying" length="80"/>
|
||||
</column>
|
||||
<column name="permission_description" not-null="true">
|
||||
<type name="character varying" length="200"/>
|
||||
</column>
|
||||
<constraint name="pk_application_permission" type="pk-constr" table="public.application_permission">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
<constraint name="application_permission_name_uidx" type="uq-constr" table="public.application_permission">
|
||||
<columns names="application,permission_name" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="role_permission" layer="0" collapse-mode="2" max-obj-count="3">
|
||||
<schema name="public"/>
|
||||
<position x="585" y="165"/>
|
||||
<column name="application_role" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="role_permission" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<constraint name="pk_role_permission_role_permission_name" type="pk-constr" table="public.role_permission">
|
||||
<columns names="application_role,role_permission" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="mail_template" layer="0" collapse-mode="2" max-obj-count="2">
|
||||
<schema name="public"/>
|
||||
<position x="290" y="1235"/>
|
||||
<column name="template_name" not-null="true">
|
||||
<type name="character varying" length="40"/>
|
||||
</column>
|
||||
<column name="template_value" not-null="true">
|
||||
<type name="text" length="0"/>
|
||||
</column>
|
||||
<constraint name="mail_template_pk" type="pk-constr" table="public.mail_template">
|
||||
<columns names="template_name" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="application" layer="0" collapse-mode="2" max-obj-count="2">
|
||||
<schema name="public"/>
|
||||
<position x="840" y="415"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="application_name" not-null="true">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<constraint name="application_pk" type="pk-constr" table="public.application">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<extension name="uuid-ossp" sql-disabled="true">
|
||||
<schema name="public"/>
|
||||
</extension>
|
||||
|
||||
<table name="account_login" layer="0" collapse-mode="2" max-obj-count="15">
|
||||
<schema name="public"/>
|
||||
<position x="1670" y="755"/>
|
||||
<column name="id" not-null="true" default-value="uuid_generate_v4()">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="account" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="account_password" not-null="true">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<column name="last_login">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="last_failed_login">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="failure_count" not-null="true" default-value="0">
|
||||
<type name="integer" length="0"/>
|
||||
</column>
|
||||
<column name="password_reset_ongoing" not-null="true" default-value="false">
|
||||
<type name="boolean" length="0"/>
|
||||
</column>
|
||||
<column name="password_reset_valid_to">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="password_reset_hash">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<column name="created_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="created_by" not-null="true">
|
||||
<type name="varchar" length="32"/>
|
||||
</column>
|
||||
<column name="last_updated_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="last_updated_by" not-null="true">
|
||||
<type name="varchar" length="32"/>
|
||||
</column>
|
||||
<constraint name="account_login_pk" type="pk-constr" table="public.account_login">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
<constraint name="account_login_uidx" type="uq-constr" table="public.account_login">
|
||||
<columns names="account" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="api_key" layer="0" collapse-mode="2" max-obj-count="6">
|
||||
<schema name="public"/>
|
||||
<position x="1612.5" y="1057.5"/>
|
||||
<column name="id" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="account" not-null="true">
|
||||
<type name="uuid" length="0"/>
|
||||
</column>
|
||||
<column name="api_key" not-null="true">
|
||||
<type name="varchar" length="200"/>
|
||||
</column>
|
||||
<column name="issued_on" not-null="true" default-value="timezone('utc'::text, now())">
|
||||
<type name="timestamptz" length="0"/>
|
||||
</column>
|
||||
<column name="expiration">
|
||||
<type name="smallint" length="0"/>
|
||||
</column>
|
||||
<constraint name="api_key_pk" type="pk-constr" table="public.api_key">
|
||||
<columns names="id" ref-type="src-columns"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<constraint name="config_key_account_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.account" table="public.config">
|
||||
<columns names="config_key_account" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="config_application_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application" table="public.config">
|
||||
<columns names="application" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="application_role_app_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application" table="public.application_role">
|
||||
<columns names="application" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="fk_account_history_username_fk" type="fk-constr" comparison-type="MATCH SIMPLE"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.account" table="public.account_history">
|
||||
<columns names="account_id" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="fk_account_role_account" type="fk-constr" comparison-type="MATCH SIMPLE"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.account" table="public.account_role">
|
||||
<columns names="account" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="fk_account_role_role_name" type="fk-constr" comparison-type="MATCH SIMPLE"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application_role" table="public.account_role">
|
||||
<columns names="account_role" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="application_permission_app_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application" table="public.application_permission">
|
||||
<columns names="application" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="fk_role_permission_application_role" type="fk-constr" comparison-type="MATCH SIMPLE"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application_role" table="public.role_permission">
|
||||
<columns names="application_role" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="fk_role_permission_role_permission" type="fk-constr" comparison-type="MATCH SIMPLE"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.application_permission" table="public.role_permission">
|
||||
<columns names="role_permission" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="account_login_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.account" table="public.account_login">
|
||||
<columns names="account" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<constraint name="api_key_account_fk" type="fk-constr" comparison-type="MATCH FULL"
|
||||
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.account" table="public.api_key">
|
||||
<columns names="account" ref-type="src-columns"/>
|
||||
<columns names="id" ref-type="dst-columns"/>
|
||||
</constraint>
|
||||
|
||||
<relationship name="rel_config_account" type="relfk" layer="0"
|
||||
src-table="public.config"
|
||||
dst-table="public.account" reference-fk="config_key_account_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_config_application" type="relfk" layer="0"
|
||||
src-table="public.config"
|
||||
dst-table="public.application" reference-fk="config_application_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_application_role_application" type="relfk" layer="0"
|
||||
src-table="public.application_role"
|
||||
dst-table="public.application" reference-fk="application_role_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_history_account" type="relfk" layer="0"
|
||||
src-table="public.account_history"
|
||||
dst-table="public.account" reference-fk="fk_account_history_username_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_account" type="relfk" layer="0"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.account" reference-fk="fk_account_role_account"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_role_application_role" type="relfk" layer="0"
|
||||
src-table="public.account_role"
|
||||
dst-table="public.application_role" reference-fk="fk_account_role_role_name"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_application_permission_application" type="relfk" layer="0"
|
||||
src-table="public.application_permission"
|
||||
dst-table="public.application" reference-fk="application_permission_app_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_role" type="relfk" layer="0"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_role" reference-fk="fk_role_permission_application_role"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_role_permission_application_permission" type="relfk" layer="0"
|
||||
src-table="public.role_permission"
|
||||
dst-table="public.application_permission" reference-fk="fk_role_permission_role_permission"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_account_login_account" type="relfk" layer="0"
|
||||
src-table="public.account_login"
|
||||
dst-table="public.account" reference-fk="account_login_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
<relationship name="rel_api_key_account" type="relfk" layer="0"
|
||||
src-table="public.api_key"
|
||||
dst-table="public.account" reference-fk="api_key_account_fk"
|
||||
src-required="false" dst-required="false"/>
|
||||
|
||||
</dbmodel>
|
||||
Reference in New Issue
Block a user