<?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="672,-40" last-zoom="1" scene-rect="0,-40,1600.57,1116.8"
	 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="Uredjaj" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="60" y="340"/>
	<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>
</table>

<table name="Deo" layers="0" collapse-mode="2" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="460" y="340"/>
	<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>
</table>

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

<table name="Komitent" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1200" y="160"/>
	<column name="IdK" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="Adresa" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<constraint name="Komitent_pk" type="pk-constr" table="public.&quot;Komitent&quot;">
		<columns names="IdK" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Firma" layers="0" collapse-mode="1" max-obj-count="2" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1000" y="480"/>
	<column name="Delatnost" not-null="true">
		<type name="varchar" length="200"/>
	</column>
</table>

<relationship name="Firma_has_one_Komitent" 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="#b359d7"
	 src-table="public.&quot;Komitent&quot;"
	 dst-table="public.&quot;Firma&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<table name="Osoba" layers="0" collapse-mode="1" max-obj-count="2" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1320" y="480"/>
	<column name="MatBr" not-null="true">
		<type name="char" length="13"/>
	</column>
</table>

<relationship name="Osoba_has_one_Komitent" 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="#9c0402"
	 src-table="public.&quot;Komitent&quot;"
	 dst-table="public.&quot;Osoba&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<table name="Racun" layers="0" collapse-mode="2" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="840" y="240"/>
	<column name="IdR" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Datum" not-null="true">
		<type name="date" length="0"/>
	</column>
	<column name="Iznos" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
	<constraint name="Racun_pk" type="pk-constr" table="public.&quot;Racun&quot;">
		<columns names="IdR" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="Komitent_has_many_Racun" 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="#93c45b"
	 src-table="public.&quot;Komitent&quot;"
	 dst-table="public.&quot;Racun&quot;"
	 src-required="true" dst-required="false"/>

<table name="Stavka" layers="0" collapse-mode="2" max-obj-count="8" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="760" y="620"/>
	<column name="IdS" 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>
	<column name="Kolicina" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Iznos" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
	<constraint name="Stavka_pk" type="pk-constr" table="public.&quot;Stavka&quot;">
		<columns names="IdS" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="Racun_has_many_Stavka" 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="#13daba"
	 src-table="public.&quot;Racun&quot;"
	 dst-table="public.&quot;Stavka&quot;"
	 src-required="true" dst-required="false"/>

<table name="Artikal" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="280" y="660"/>
	<column name="IdU" 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="Uredjaj_pk" type="pk-constr" table="public.&quot;Artikal&quot;">
		<columns names="IdU" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="Deo_has_one_Artikal" 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="#22a9a4"
	 src-table="public.&quot;Artikal&quot;"
	 dst-table="public.&quot;Deo&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Uredjaj_has_one_Artikal" 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="#18a245"
	 src-table="public.&quot;Artikal&quot;"
	 dst-table="public.&quot;Uredjaj&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

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

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

<relationship name="Uredjaj_has_many_Deo" 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="#929863"
	 src-table="public.&quot;Uredjaj&quot;"
	 dst-table="public.&quot;Deo&quot;"
	 src-required="true" dst-required="false"/>

<relationship name="Artikal_has_many_Stavka" 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="#7d3fef"
	 src-table="public.&quot;Artikal&quot;"
	 dst-table="public.&quot;Stavka&quot;"
	 src-required="true" dst-required="false"/>

<table name="Uplata" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="860" y="0"/>
	<column name="IdU" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Datum" not-null="true">
		<type name="date" length="0"/>
	</column>
	<column name="Iznos" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
	<constraint name="Uplata_pk" type="pk-constr" table="public.&quot;Uplata&quot;">
		<columns names="IdU" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="many_Uplata_has_many_Racun" 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="#2d2d8e"
	 src-table="public.&quot;Uplata&quot;"
	 dst-table="public.&quot;Racun&quot;"
	 src-required="false" dst-required="false"
	 table-name="OdnosiSe">
	<label ref-type="name-label">
		<position x="117.474" y="-40.553"/>
	</label>
</relationship>

</dbmodel>
