<?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="1.2.2" use-changelog="false" max-obj-count="13"
	 gen-disabled-objs-code="false" show-sys-schemas-rects="true"
	 last-position="491,0" last-zoom="1" scene-rect="0,0,1570.8,1164.92"
	 default-schema="public" default-owner="postgres"
	 layers="Default layer"
	 active-layers="0"
	 layer-name-colors="#000000"
	 layer-rect-colors="#b4b4b4"
	 show-layer-names="false" show-layer-rects="false">
<database name="new_database" is-template="false" allow-conns="true">
</database>

<schema name="public" layers="0" fill-color="#e1e1e1" name-color="#000000" sql-disabled="true">
</schema>

<table name="Distributer" layers="0" collapse-mode="1" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="280" y="260"/>
	<column name="IdD" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv">
		<type name="varchar" length="200"/>
	</column>
	<column name="Adresa" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="PIB" not-null="true">
		<type name="varchar" length="15"/>
	</column>
	<constraint name="UQ_PIB" type="uq-constr" table="public.&quot;Distributer&quot;">
		<columns names="PIB" ref-type="src-columns"/>
	</constraint>
	<constraint name="Distributer_pk" type="pk-constr" table="public.&quot;Distributer&quot;">
		<columns names="IdD" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Grad" layers="0" collapse-mode="1" max-obj-count="2" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="780" y="280"/>
	<column name="IdG" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<constraint name="Grad_pk" type="pk-constr" table="public.&quot;Grad&quot;">
		<columns names="IdG" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="many_Distributer_has_many_Grad" type="relnn" layers="0"
	 src-col-pattern="{sc}_{st}" dst-col-pattern="{sc}_{dt}"
	 pk-pattern="{gt}_pk" uq-pattern="{gt}_uq"
	 src-fk-pattern="{st}_fk" dst-fk-pattern="{dt}_fk"
	 pk-col-pattern="id"
	 fk-idx-pattern="{gt}_idx"
	 custom-color="#0fbbdd"
	 src-table="public.&quot;Distributer&quot;"
	 dst-table="public.&quot;Grad&quot;"
	 src-required="false" dst-required="false"
	 table-name="Pokriva"/>

<table name="Apoteka" layers="0" collapse-mode="1" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="280" y="760"/>
	<column name="IdA" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="PotencijalProdaje" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<constraint name="Apoteka_pk" type="pk-constr" table="public.&quot;Apoteka&quot;">
		<columns names="IdA" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="Grad_has_many_Apoteka" type="rel1n" layers="0"
	 src-col-pattern="IdG"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#8460bd"
	 src-table="public.&quot;Grad&quot;"
	 dst-table="public.&quot;Apoteka&quot;"
	 src-required="true" dst-required="false"/>

<table name="Proizvod" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1160" y="520"/>
	<column name="IdP" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="Cena" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
	<constraint name="Proizvod_pk" type="pk-constr" table="public.&quot;Proizvod&quot;">
		<columns names="IdP" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Lek" layers="0" collapse-mode="1" max-obj-count="2" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="900" y="780"/>
	<column name="Licenca" not-null="true">
		<type name="smallint" length="0"/>
	</column>
</table>

<relationship name="Lek_has_one_Proizvod" type="rel11" layers="0"
	 src-col-pattern="IdL"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#195448"
	 src-table="public.&quot;Proizvod&quot;"
	 dst-table="public.&quot;Lek&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<table name="NeLek" layers="0" collapse-mode="1" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1060" y="100"/>
	<column name="Opis" not-null="true">
		<type name="varchar" length="200"/>
	</column>
</table>

<relationship name="NeLek_has_one_Proizvod" type="rel11" layers="0"
	 src-col-pattern="IdNL"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#54df22"
	 src-table="public.&quot;Proizvod&quot;"
	 dst-table="public.&quot;NeLek&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<table name="Popust" layers="0" collapse-mode="1" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="720" y="540"/>
	<column name="Popust" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
</table>

<relationship name="Proizvod_has_many_Popust" type="rel1n" layers="0"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#1f91be"
	 src-table="public.&quot;Proizvod&quot;"
	 dst-table="public.&quot;Popust&quot;"
	 src-required="true" dst-required="false"/>

<table name="Saradnja" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="260" y="480"/>
</table>

<relationship name="Distributer_has_many_Saradnja" type="rel1n" layers="0"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#d56b4d"
	 src-table="public.&quot;Distributer&quot;"
	 dst-table="public.&quot;Saradnja&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Apoteka_has_many_Saradnja" type="rel1n" layers="0"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#8587fe"
	 src-table="public.&quot;Apoteka&quot;"
	 dst-table="public.&quot;Saradnja&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Popust_has_one_Saradnja" type="rel11" layers="0"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#a1aca9"
	 src-table="public.&quot;Saradnja&quot;"
	 dst-table="public.&quot;Popust&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<table name="Zamena" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="880" y="1000"/>
</table>

<relationship name="Lek_has_many_Zamena" type="rel1n" layers="0"
	 src-col-pattern="IdL_Menja"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#050e52"
	 src-table="public.&quot;Lek&quot;"
	 dst-table="public.&quot;Zamena&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Lek_has_many_Zamena2" type="rel1n" layers="0"
	 src-col-pattern="IdL_Zamenjen"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#fb1bd3"
	 src-table="public.&quot;Lek&quot;"
	 dst-table="public.&quot;Zamena&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Distributer_has_many_NeLek" type="rel1n" layers="0"
	 src-col-pattern="IdDR"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#ca50a1"
	 src-table="public.&quot;Distributer&quot;"
	 dst-table="public.&quot;NeLek&quot;"
	 src-required="false" dst-required="false"/>

</dbmodel>
