<?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="9"
	 gen-disabled-objs-code="false" show-sys-schemas-rects="true"
	 last-position="0,105" last-zoom="1"
	 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="Radnik" layers="0" collapse-mode="1" max-obj-count="8" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="300" y="300"/>
	<column name="IdR" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Ime" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="Prezime" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="BrLK" not-null="true">
		<type name="varchar" length="7"/>
	</column>
	<constraint name="UQ_BrLK" type="uq-constr" table="public.&quot;Radnik&quot;">
		<columns names="BrLK" ref-type="src-columns"/>
	</constraint>
	<constraint name="Radnik_pk" type="pk-constr" table="public.&quot;Radnik&quot;">
		<columns names="IdR" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Firma" layers="0" collapse-mode="1" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="600" y="860"/>
	<column name="IdF" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Naziv" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="PIB">
		<type name="varchar" length="20"/>
	</column>
	<constraint name="UQ_PIB" type="pk-constr" table="public.&quot;Firma&quot;">
		<columns names="IdF" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Kancelarija" layers="0" collapse-mode="1" max-obj-count="7" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="920" y="605"/>
	<column name="IdK" not-null="true">
		<type name="smallint" length="0"/>
	</column>
	<column name="Ulica" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="Broj" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="BrRadnika" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<constraint name="CH_BrRadnika" type="ck-constr" table="public.&quot;Kancelarija&quot;">
			<expression> <![CDATA[BrRadnika >= 0]]> </expression>
	</constraint>
	<constraint name="Kancelarija_pk" type="pk-constr" table="public.&quot;Kancelarija&quot;">
		<columns names="IdK" ref-type="src-columns"/>
	</constraint>
</table>

<table name="Grad" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1260" y="420"/>
	<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="Grad_has_many_Kancelarija" 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="#8cf92a"
	 src-table="public.&quot;Grad&quot;"
	 dst-table="public.&quot;Kancelarija&quot;"
	 src-required="true" dst-required="false"/>

<relationship name="Firma_has_many_Kancelarija" 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="#e7d00c"
	 src-table="public.&quot;Firma&quot;"
	 dst-table="public.&quot;Kancelarija&quot;"
	 src-required="true" dst-required="false"/>

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

<relationship name="Drzava_has_many_Grad" 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="#f3eb2e"
	 src-table="public.&quot;Drzava&quot;"
	 dst-table="public.&quot;Grad&quot;"
	 src-required="true" dst-required="false"/>

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

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

<relationship name="Funkcija_has_many_Radnik2" type="rel1n" layers="0"
	 src-col-pattern="{sc}_{st}2"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#d3c37d"
	 src-table="public.&quot;Funkcija&quot;"
	 dst-table="public.&quot;Radnik&quot;"
	 src-required="false" dst-required="false"/>

<relationship name="many_Funkcija_has_many_Kancelarija" 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="#afd8cf"
	 src-table="public.&quot;Funkcija&quot;"
	 dst-table="public.&quot;Kancelarija&quot;"
	 src-required="false" dst-required="false"
	 table-name="Funkcija_Kancelarija">
	<column name="BrSlobodnihMesta" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<constraint name="CH_BrSlobodnihMesta" type="ck-constr" table="public.&quot;Funkcija_Kancelarija&quot;">
			<expression> <![CDATA[BrSlobodnihMesta >= 0]]> </expression>
	</constraint>
</relationship>

<relationship name="many_Funkcija_has_many_Firma" 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="#aa2a59"
	 src-table="public.&quot;Funkcija&quot;"
	 dst-table="public.&quot;Firma&quot;"
	 src-required="false" dst-required="false"
	 table-name="FirmaFunkcija">
	<column name="Plata" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
</relationship>

<relationship name="Kancelarija_has_many_Radnik" 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="#35ca4b"
	 src-table="public.&quot;Kancelarija&quot;"
	 dst-table="public.&quot;Radnik&quot;"
	 src-required="true" dst-required="false"/>

</dbmodel>
