<?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="412,453" 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="Oprema" layers="0" collapse-mode="1" max-obj-count="9" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="180" y="480"/>
	<column name="InvBr" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="DatumPocetkaUpotrebe" not-null="true">
		<type name="date" length="0"/>
	</column>
	<column name="TrajanjeGarancije" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Vrednost" not-null="true">
		<type name="decimal" length="10" precision="2"/>
	</column>
	<column name="Opis">
		<type name="varchar" length="500"/>
	</column>
	<constraint name="Oprema_pk" type="pk-constr" table="public.&quot;Oprema&quot;">
		<columns names="InvBr" ref-type="src-columns"/>
	</constraint>

	<customidxs object-type="column">
		<object name="IdT" index="5"/>
	</customidxs>
	<customidxs object-type="constraint">
		<object name="Tip_fk" index="1"/>
	</customidxs></table>

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

<relationship name="Tip_has_many_Oprema" type="rel1n" layers="0"
	 src-col-pattern="IdT"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#1677e3"
	 src-table="public.&quot;Tip&quot;"
	 dst-table="public.&quot;Oprema&quot;"
	 src-required="true" dst-required="false">
	<label ref-type="name-label">
		<position x="-97.5897" y="-33.953"/>
	</label>
</relationship>

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

	<customidxs object-type="column">
		<object name="IdF" index="1"/>
	</customidxs>
	<customidxs object-type="constraint">
		<object name="Firma_pk" index="0"/>
		<object name="Instaler_fk" index="1"/>
	</customidxs></table>

<table name="Soba" layers="0" collapse-mode="1" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="600" y="240"/>
	<column name="IdS" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Sprat" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<column name="Broj" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<constraint name="UQ_Broj" type="uq-constr" table="public.&quot;Soba&quot;">
		<columns names="Broj" ref-type="src-columns"/>
	</constraint>
	<constraint name="Soba_pk" type="pk-constr" table="public.&quot;Soba&quot;">
		<columns names="IdS" ref-type="src-columns"/>
	</constraint>
</table>

<relationship name="many_Oprema_has_many_Soba" 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="#8d8850"
	 src-table="public.&quot;Oprema&quot;"
	 dst-table="public.&quot;Soba&quot;"
	 src-required="false" dst-required="false"
	 table-name="Rasporedjena"/>

<table name="Radnik" layers="0" collapse-mode="1" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1060" y="240"/>
	<column name="Ime" not-null="true">
		<type name="varchar" length="200"/>
	</column>
	<column name="BrTelefona" not-null="true">
		<type name="varchar" length="50"/>
	</column>
	<constraint name="UQ_BrTelefona" type="uq-constr" table="public.&quot;Radnik&quot;">
		<columns names="BrTelefona" ref-type="src-columns"/>
	</constraint>
</table>

<table name="SeSastoji" layers="0" collapse-mode="2" max-obj-count="1" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="240" y="800"/>
</table>

<relationship name="Oprema_has_many_SeSastoji" type="rel1n" layers="0"
	 src-col-pattern="IdO_Celina"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#d28b8f"
	 src-table="public.&quot;Oprema&quot;"
	 dst-table="public.&quot;SeSastoji&quot;"
	 src-required="true" dst-required="false"/>

<table name="Instaler" layers="0" collapse-mode="2" max-obj-count="1" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="1180" y="580"/>
	<column name="IdI" not-null="true">
		<type name="integer" length="0"/>
	</column>
	<constraint name="Instaler_pk" type="pk-constr" table="public.&quot;Instaler&quot;">
		<columns names="IdI" ref-type="src-columns"/>
	</constraint>
</table>

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

<relationship name="Firma_has_many_Oprema" type="rel1n" layers="0"
	 src-col-pattern="IdFP"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#a878b9"
	 src-table="public.&quot;Firma&quot;"
	 dst-table="public.&quot;Oprema&quot;"
	 src-required="false" dst-required="false"/>

<relationship name="Firma_has_many_Oprema2" type="rel1n" layers="0"
	 src-col-pattern="IdFI"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 fk-idx-pattern="{st}_idx"
	 custom-color="#fdd1c8"
	 src-table="public.&quot;Firma&quot;"
	 dst-table="public.&quot;Oprema&quot;"
	 src-required="false" dst-required="false"/>

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

<relationship name="Radnik_has_many_Soba" 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="#88266f"
	 src-table="public.&quot;Radnik&quot;"
	 dst-table="public.&quot;Soba&quot;"
	 src-required="true" dst-required="false"/>

<table name="Instalacija" layers="0" collapse-mode="1" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="780" y="760"/>
</table>

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

<relationship name="Softver_has_many_Instalacija" 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="#82402a"
	 src-table="public.&quot;Softver&quot;"
	 dst-table="public.&quot;Instalacija&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Instaler_has_many_Instalacija" 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="#6e0529"
	 src-table="public.&quot;Instaler&quot;"
	 dst-table="public.&quot;Instalacija&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

<relationship name="Oprema_has_many_Instalacija" 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="#279c15"
	 src-table="public.&quot;Oprema&quot;"
	 dst-table="public.&quot;Instalacija&quot;"
	 src-required="true" dst-required="false"
	 identifier="true"
/>

</dbmodel>
