migrated API key support from PCD

This commit is contained in:
2018-11-16 16:21:43 +01:00
parent b2c2619dc4
commit 46f2827338
7 changed files with 505 additions and 11 deletions

View File

@ -3,7 +3,7 @@
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="315,0" last-zoom="0.7"
<dbmodel pgmodeler-ver="0.9.1" author="Joern Muehlencord" last-position="46,0" last-zoom="0.6"
default-schema="public">
<database name="account_test" encoding="UTF8" lc-collate="C" lc-ctype="C" is-template="false" allow-conns="true" sql-disabled="true">
</database>
@ -13,7 +13,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="config" hide-ext-attribs="true">
<schema name="public"/>
<position x="1880" y="380"/>
<position x="1655" y="520"/>
<column name="application" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -36,7 +36,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="application_role" hide-ext-attribs="true">
<schema name="public"/>
<position x="160" y="500"/>
<position x="5" y="450"/>
<column name="id" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -59,7 +59,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="account" hide-ext-attribs="true">
<schema name="public"/>
<position x="1240" y="100"/>
<position x="1020" y="795"/>
<column name="id" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -100,7 +100,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="account_history" hide-ext-attribs="true">
<schema name="public"/>
<position x="760" y="340"/>
<position x="230" y="930"/>
<column name="id" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -129,7 +129,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="account_role" hide-ext-attribs="true">
<schema name="public"/>
<position x="740" y="100"/>
<position x="540" y="620"/>
<column name="account" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -143,7 +143,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="application_permission" hide-ext-attribs="true">
<schema name="public"/>
<position x="1560" y="740"/>
<position x="1290" y="180"/>
<column name="id" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -166,7 +166,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="role_permission" hide-ext-attribs="true">
<schema name="public"/>
<position x="960" y="800"/>
<position x="585" y="165"/>
<column name="application_role" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -180,7 +180,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="mail_template" hide-ext-attribs="true">
<schema name="public"/>
<position x="280" y="860"/>
<position x="290" y="1235"/>
<column name="template_name" not-null="true">
<type name="character varying" length="40"/>
</column>
@ -194,7 +194,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="application" hide-ext-attribs="true">
<schema name="public"/>
<position x="1080" y="560"/>
<position x="840" y="415"/>
<column name="id" not-null="true">
<type name="uuid" length="0"/>
</column>
@ -212,7 +212,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<table name="account_login" hide-ext-attribs="true">
<schema name="public"/>
<position x="1880" y="20"/>
<position x="1670" y="755"/>
<column name="id" not-null="true" default-value="uuid_generate_v4()">
<type name="uuid" length="0"/>
</column>
@ -260,6 +260,29 @@ CAUTION: Do not modify this file unless you know what you are doing.
</constraint>
</table>
<table name="api_key">
<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"/>
@ -320,6 +343,12 @@ CAUTION: Do not modify this file unless you know what you are doing.
<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_account_history_account" type="relfk"
custom-color="#83af1f"
src-table="public.account_history"
@ -375,4 +404,9 @@ CAUTION: Do not modify this file unless you know what you are doing.
dst-table="public.application" reference-fk="config_application_fk"
src-required="false" dst-required="false"/>
<relationship name="rel_api_key_account" type="relfk"
src-table="public.api_key"
dst-table="public.account" reference-fk="api_key_account_fk"
src-required="false" dst-required="false"/>
</dbmodel>