| 1 | create table dok_dokument_potpis
|
|---|
| 2 | (
|
|---|
| 3 | id int4 default nextval('dok_dokument_potpis_id_seq'::regclass) not null
|
|---|
| 4 | constraint dok_dokument_potpis_pkey
|
|---|
| 5 | primary key,
|
|---|
| 6 | vraboten_angazman_id int4 not null,
|
|---|
| 7 | vraboten_funkcija_id int4,
|
|---|
| 8 | generiran_dokument_id int4 not null,
|
|---|
| 9 | tip_potpis varchar(255),
|
|---|
| 10 | potpis text,
|
|---|
| 11 | data timestamp(6)
|
|---|
| 12 | );
|
|---|
| 13 |
|
|---|
| 14 | create table dok_dokument_templejt_atributi
|
|---|
| 15 | (
|
|---|
| 16 | id int4 default nextval('dok_dokument_templejt_atributi_id_seq'::regclass) not null
|
|---|
| 17 | constraint dok_dokument_templejt_atributi_pkey
|
|---|
| 18 | primary key,
|
|---|
| 19 | dokument_templejt_id int4 not null,
|
|---|
| 20 | ime_atribut varchar(255),
|
|---|
| 21 | regex varchar(255),
|
|---|
| 22 | tip_atribut_id int4 not null,
|
|---|
| 23 | zadolzitelen bool
|
|---|
| 24 | );
|
|---|
| 25 |
|
|---|
| 26 | create table dok_dokument_templejti
|
|---|
| 27 | (
|
|---|
| 28 | id int4 default nextval('dok_dokument_templejti_id_seq'::regclass) not null
|
|---|
| 29 | constraint dok_dokument_templejti_pkey
|
|---|
| 30 | primary key,
|
|---|
| 31 | tip_dokument_organizaciona_edinica_id int4 not null,
|
|---|
| 32 | templejt text,
|
|---|
| 33 | aktiven bool
|
|---|
| 34 | );
|
|---|
| 35 |
|
|---|
| 36 | create table dok_generiran_dokument
|
|---|
| 37 | (
|
|---|
| 38 | id int4 default nextval('dok_generiran_dokument_id_seq'::regclass) not null
|
|---|
| 39 | constraint dok_generiran_dokument_pkey
|
|---|
| 40 | primary key,
|
|---|
| 41 | tip_dokument_organizaciona_edinica_id int4 not null,
|
|---|
| 42 | dokument_templejt_id int4 not null,
|
|---|
| 43 | url varchar(255),
|
|---|
| 44 | user_id int4 not null
|
|---|
| 45 | );
|
|---|
| 46 |
|
|---|
| 47 | create table dok_generiran_dokument_vrednosti
|
|---|
| 48 | (
|
|---|
| 49 | id int4 default nextval('dok_generiran_dokument_vrednosti_id_seq'::regclass) not null
|
|---|
| 50 | constraint dok_generiran_dokument_vrednosti_pkey
|
|---|
| 51 | primary key,
|
|---|
| 52 | dokument_templejt_atributi_id int4 not null,
|
|---|
| 53 | generiran_dokument_id int4 not null,
|
|---|
| 54 | string_vrednost varchar(255),
|
|---|
| 55 | numericka_vrednost numeric,
|
|---|
| 56 | boolean_vrednost bool
|
|---|
| 57 | );
|
|---|
| 58 |
|
|---|
| 59 | create table dok_tip_dokumenti_organizaciona_edinica
|
|---|
| 60 | (
|
|---|
| 61 | id int4 default nextval('dok_tip_dokumenti_organizaciona_edinica_id_seq'::regclass) not null
|
|---|
| 62 | constraint dok_tip_dokumenti_organizaciona_edinica_pkey
|
|---|
| 63 | primary key,
|
|---|
| 64 | dokument_ime varchar(255),
|
|---|
| 65 | organizaciona_edinica_id int4 not null,
|
|---|
| 66 | tip_naplata_organizaciona_edinica_id int4 not null
|
|---|
| 67 | );
|
|---|
| 68 |
|
|---|
| 69 | create table drzavi
|
|---|
| 70 | (
|
|---|
| 71 | id int4 default nextval('drzavi_id_seq'::regclass) not null
|
|---|
| 72 | constraint drzavi_pkey
|
|---|
| 73 | primary key,
|
|---|
| 74 | drzava_kod varchar(255),
|
|---|
| 75 | drzava_ime varchar(255)
|
|---|
| 76 | );
|
|---|
| 77 |
|
|---|
| 78 | create table ent_entiteti
|
|---|
| 79 | (
|
|---|
| 80 | id int4 default nextval('ent_entiteti_id_seq'::regclass) not null
|
|---|
| 81 | constraint ent_entiteti_pkey
|
|---|
| 82 | primary key,
|
|---|
| 83 | ime_entitet varchar(255)
|
|---|
| 84 | constraint ent_entiteti_ime_entitet_key
|
|---|
| 85 | unique,
|
|---|
| 86 | user_id int4 not null
|
|---|
| 87 | );
|
|---|
| 88 |
|
|---|
| 89 | create table ent_entiteti_smetki
|
|---|
| 90 | (
|
|---|
| 91 | id int4 default nextval('ent_entiteti_smetki_id_seq'::regclass) not null
|
|---|
| 92 | constraint ent_entiteti_smetki_pkey
|
|---|
| 93 | primary key,
|
|---|
| 94 | entitet_id int4 not null,
|
|---|
| 95 | transakciska_smetka_id int4 not null,
|
|---|
| 96 | aktivna bool
|
|---|
| 97 | );
|
|---|
| 98 |
|
|---|
| 99 | create table fin_banki
|
|---|
| 100 | (
|
|---|
| 101 | id int4 default nextval('fin_banki_id_seq'::regclass) not null
|
|---|
| 102 | constraint fin_banki_pkey
|
|---|
| 103 | primary key,
|
|---|
| 104 | ime_banka varchar(255) not null,
|
|---|
| 105 | swift_bic varchar(255),
|
|---|
| 106 | drzava_kod varchar(2)
|
|---|
| 107 | );
|
|---|
| 108 |
|
|---|
| 109 | create table fin_finansiska_obvrska
|
|---|
| 110 | (
|
|---|
| 111 | id int4 default nextval('fin_finansiska_obvrska_id_seq'::regclass) not null
|
|---|
| 112 | constraint fin_finansiska_obvrska_pkey
|
|---|
| 113 | primary key,
|
|---|
| 114 | user_id int4 not null,
|
|---|
| 115 | organizaciona_edinica_id int4 not null,
|
|---|
| 116 | tip_naplata_organizaciona_edinica_id int4 not null,
|
|---|
| 117 | tip_naplati_cenovnik_id int4,
|
|---|
| 118 | status_finansiska_obvrska_id int4 not null,
|
|---|
| 119 | dokument_id int4,
|
|---|
| 120 | datum_kreiranje timestamp(6) not null,
|
|---|
| 121 | datum_dospevanje date,
|
|---|
| 122 | originalna_suma numeric(14, 2) not null,
|
|---|
| 123 | otvorena_suma numeric(14, 2) not null,
|
|---|
| 124 | vid_valuta_id int4 not null,
|
|---|
| 125 | opis varchar(255),
|
|---|
| 126 | finansiska_obvrska_id int4
|
|---|
| 127 | );
|
|---|
| 128 |
|
|---|
| 129 | create table fin_finansiska_obvrska_stavka
|
|---|
| 130 | (
|
|---|
| 131 | id int4 default nextval('fin_finansiska_obvrska_stavka_id_seq'::regclass) not null
|
|---|
| 132 | constraint fin_finansiska_obvrska_stavka_pkey
|
|---|
| 133 | primary key,
|
|---|
| 134 | finansiska_obvrska_id int4 not null,
|
|---|
| 135 | naziv_stavka varchar(255) not null,
|
|---|
| 136 | referenca_tip varchar(255),
|
|---|
| 137 | referenca_id int4,
|
|---|
| 138 | kolicina numeric(12, 2) default 1 not null,
|
|---|
| 139 | edinicna_cena numeric(14, 2) not null,
|
|---|
| 140 | iznos numeric(14, 2) not null
|
|---|
| 141 | );
|
|---|
| 142 |
|
|---|
| 143 | create table fin_finansiski_dokument
|
|---|
| 144 | (
|
|---|
| 145 | id int4 default nextval('fin_finansiski_dokument_id_seq'::regclass) not null
|
|---|
| 146 | constraint fin_finansiski_dokument_pkey
|
|---|
| 147 | primary key,
|
|---|
| 148 | finansiski_dokument_tip_id int4 not null,
|
|---|
| 149 | organizaciona_edinica_id int4 not null,
|
|---|
| 150 | user_id int4,
|
|---|
| 151 | dokument_broj varchar(255) not null,
|
|---|
| 152 | datum_izdavanje date not null,
|
|---|
| 153 | status varchar(255) not null,
|
|---|
| 154 | vid_valuta_id int4 not null,
|
|---|
| 155 | vkupen_iznos numeric(14, 2) not null,
|
|---|
| 156 | izvoren_tip varchar(255)
|
|---|
| 157 | );
|
|---|
| 158 |
|
|---|
| 159 | create table fin_finansiski_dokument_tip
|
|---|
| 160 | (
|
|---|
| 161 | id int4 default nextval('fin_finansiski_dokument_tip_id_seq'::regclass) not null
|
|---|
| 162 | constraint fin_finansiski_dokument_tip_pkey
|
|---|
| 163 | primary key,
|
|---|
| 164 | kod varchar(255) not null
|
|---|
| 165 | constraint fin_finansiski_dokument_tip_kod_key
|
|---|
| 166 | unique,
|
|---|
| 167 | ime varchar(255) not null,
|
|---|
| 168 | nasoka varchar(255) not null
|
|---|
| 169 | );
|
|---|
| 170 |
|
|---|
| 171 | create table fin_finansiski_dokument_vrska
|
|---|
| 172 | (
|
|---|
| 173 | id int4 default nextval('fin_finansiski_dokument_vrska_id_seq'::regclass) not null
|
|---|
| 174 | constraint fin_finansiski_dokument_vrska_pkey
|
|---|
| 175 | primary key,
|
|---|
| 176 | parent_dokument_id int4 not null,
|
|---|
| 177 | child_dokument_id int4 not null,
|
|---|
| 178 | relation_type varchar(255) not null
|
|---|
| 179 | );
|
|---|
| 180 |
|
|---|
| 181 | create table fin_isplata_alokacija
|
|---|
| 182 | (
|
|---|
| 183 | id int4 default nextval('fin_isplata_alokacija_id_seq'::regclass) not null
|
|---|
| 184 | constraint fin_isplata_alokacija_pkey
|
|---|
| 185 | primary key,
|
|---|
| 186 | isplata_id int4 not null,
|
|---|
| 187 | isplatna_obvrska_id int4 not null,
|
|---|
| 188 | alocirana_suma numeric(14, 2) not null,
|
|---|
| 189 | created_at timestamp(6) not null
|
|---|
| 190 | );
|
|---|
| 191 |
|
|---|
| 192 | create table fin_isplati
|
|---|
| 193 | (
|
|---|
| 194 | id int4 default nextval('fin_isplati_id_seq'::regclass) not null
|
|---|
| 195 | constraint fin_isplati_pkey
|
|---|
| 196 | primary key,
|
|---|
| 197 | user_id int4 not null,
|
|---|
| 198 | korisnik_isplata_id int4 not null,
|
|---|
| 199 | transakciska_smetka_id int4 not null,
|
|---|
| 200 | organizaciona_edinica_id int4 not null,
|
|---|
| 201 | naplatena_suma numeric(14, 2) not null,
|
|---|
| 202 | vid_valuta_id int4 not null,
|
|---|
| 203 | status_transakcija_id int4 not null,
|
|---|
| 204 | nadvoresna_referenca varchar(255),
|
|---|
| 205 | pobarana timestamp(6),
|
|---|
| 206 | izvrsena timestamp(6),
|
|---|
| 207 | data date
|
|---|
| 208 | );
|
|---|
| 209 |
|
|---|
| 210 | create table fin_isplatna_obvrska
|
|---|
| 211 | (
|
|---|
| 212 | id int4 default nextval('fin_isplatna_obvrska_id_seq'::regclass) not null
|
|---|
| 213 | constraint fin_isplatna_obvrska_pkey
|
|---|
| 214 | primary key,
|
|---|
| 215 | user_id int4 not null,
|
|---|
| 216 | organizaciona_edinica_id int4 not null,
|
|---|
| 217 | tip_isplatna_obvrska_id int4 not null,
|
|---|
| 218 | status_isplatna_obvrska_id int4 not null,
|
|---|
| 219 | dokument_id int4 not null,
|
|---|
| 220 | plata_stavka_vraboten_id int4,
|
|---|
| 221 | izvoren_tip varchar(255),
|
|---|
| 222 | originalna_suma numeric(14, 2) not null,
|
|---|
| 223 | otvorena_suma numeric(14, 2) not null,
|
|---|
| 224 | vid_valuta_id int4 not null,
|
|---|
| 225 | kreirano_na timestamp(6) not null,
|
|---|
| 226 | odobreno_na timestamp(6),
|
|---|
| 227 | due_date date,
|
|---|
| 228 | opis varchar(255)
|
|---|
| 229 | );
|
|---|
| 230 |
|
|---|
| 231 | create table fin_korisnici_isplata
|
|---|
| 232 | (
|
|---|
| 233 | id int4 default nextval('fin_korisnici_isplata_id_seq'::regclass) not null
|
|---|
| 234 | constraint fin_korisnici_isplata_pkey
|
|---|
| 235 | primary key,
|
|---|
| 236 | transakciska_smetka_id int4 not null,
|
|---|
| 237 | user_id int4 not null
|
|---|
| 238 | );
|
|---|
| 239 |
|
|---|
| 240 | create table fin_korisnici_naplati
|
|---|
| 241 | (
|
|---|
| 242 | id int4 default nextval('fin_korisnici_naplati_id_seq'::regclass) not null
|
|---|
| 243 | constraint fin_korisnici_naplati_pkey
|
|---|
| 244 | primary key,
|
|---|
| 245 | korisnik_vid_naplata_id int4 not null,
|
|---|
| 246 | user_id int4 not null
|
|---|
| 247 | );
|
|---|
| 248 |
|
|---|
| 249 | create table fin_korisnik_naplata_atributi_vrednosti
|
|---|
| 250 | (
|
|---|
| 251 | id int4 default nextval('fin_korisnik_naplata_atributi_vrednosti_id_seq'::regclass) not null
|
|---|
| 252 | constraint fin_korisnik_naplata_atributi_vrednosti_pkey
|
|---|
| 253 | primary key,
|
|---|
| 254 | korisnici_naplata_id int4 not null,
|
|---|
| 255 | korisnik_vid_naplata_atribut_id int4 not null,
|
|---|
| 256 | string_vrednost varchar(255),
|
|---|
| 257 | numericka_vrednost numeric,
|
|---|
| 258 | boolean_vrednost bool
|
|---|
| 259 | );
|
|---|
| 260 |
|
|---|
| 261 | create table fin_korisnik_vid_naplati
|
|---|
| 262 | (
|
|---|
| 263 | id int4 default nextval('fin_korisnik_vid_naplati_id_seq'::regclass) not null
|
|---|
| 264 | constraint fin_korisnik_vid_naplati_pkey
|
|---|
| 265 | primary key,
|
|---|
| 266 | ime_vid varchar(255)
|
|---|
| 267 | );
|
|---|
| 268 |
|
|---|
| 269 | create table fin_korisnik_vid_naplati_attributi
|
|---|
| 270 | (
|
|---|
| 271 | id int4 default nextval('fin_korisnik_vid_naplati_attributi_id_seq'::regclass) not null
|
|---|
| 272 | constraint fin_korisnik_vid_naplati_attributi_pkey
|
|---|
| 273 | primary key,
|
|---|
| 274 | korisnik_vid_naplata_id int4 not null,
|
|---|
| 275 | tip_atribut_id int4 not null,
|
|---|
| 276 | ime_atribut varchar(255),
|
|---|
| 277 | zadolzitelen bool
|
|---|
| 278 | );
|
|---|
| 279 |
|
|---|
| 280 | create table fin_naplata_alokacija
|
|---|
| 281 | (
|
|---|
| 282 | id int4 default nextval('fin_naplata_alokacija_id_seq'::regclass) not null
|
|---|
| 283 | constraint fin_naplata_alokacija_pkey
|
|---|
| 284 | primary key,
|
|---|
| 285 | naplata_id int4 not null,
|
|---|
| 286 | finansiska_obvrska_id int4 not null,
|
|---|
| 287 | finansiska_obvrska_stavka_id int4,
|
|---|
| 288 | alocirana_suma numeric(14, 2),
|
|---|
| 289 | created_at timestamp(6) not null
|
|---|
| 290 | );
|
|---|
| 291 |
|
|---|
| 292 | create table fin_naplati
|
|---|
| 293 | (
|
|---|
| 294 | id int4 default nextval('fin_naplati_id_seq'::regclass) not null
|
|---|
| 295 | constraint fin_naplati_pkey
|
|---|
| 296 | primary key,
|
|---|
| 297 | user_id int4 not null,
|
|---|
| 298 | korisnik_naplata_id int4 not null,
|
|---|
| 299 | transakciska_smetka_id int4 not null,
|
|---|
| 300 | organizaciona_edinica_id int4 not null,
|
|---|
| 301 | naplatena_suma numeric(14, 2) not null,
|
|---|
| 302 | vid_valuta_id int4 not null,
|
|---|
| 303 | status_transakcija_id int4 not null,
|
|---|
| 304 | nadvoresna_referenca varchar(255),
|
|---|
| 305 | provider_transaction_id varchar(255),
|
|---|
| 306 | requested_at timestamp(6),
|
|---|
| 307 | confirmed_at timestamp(6),
|
|---|
| 308 | data date
|
|---|
| 309 | );
|
|---|
| 310 |
|
|---|
| 311 | create table fin_plata_komponenta
|
|---|
| 312 | (
|
|---|
| 313 | id int4 default nextval('fin_plata_komponenta_id_seq'::regclass) not null
|
|---|
| 314 | constraint fin_plata_komponenta_pkey
|
|---|
| 315 | primary key,
|
|---|
| 316 | plata_stavka_vraboten_id int4 not null,
|
|---|
| 317 | tip_platna_komponenta_id int4 not null,
|
|---|
| 318 | kvantitet numeric(12, 2),
|
|---|
| 319 | stapka numeric(14, 2),
|
|---|
| 320 | iznos numeric(14, 2) not null,
|
|---|
| 321 | izvoren_tip varchar(255),
|
|---|
| 322 | opis varchar(255)
|
|---|
| 323 | );
|
|---|
| 324 |
|
|---|
| 325 | create table fin_plata_period
|
|---|
| 326 | (
|
|---|
| 327 | id int4 default nextval('fin_plata_period_id_seq'::regclass) not null
|
|---|
| 328 | constraint fin_plata_period_pkey
|
|---|
| 329 | primary key,
|
|---|
| 330 | organizaciona_edinica_id int4 not null,
|
|---|
| 331 | datum_od date not null,
|
|---|
| 332 | datum_do date not null,
|
|---|
| 333 | status_plata_period_id int4 not null,
|
|---|
| 334 | created_at timestamp(6) not null,
|
|---|
| 335 | approved_at timestamp(6)
|
|---|
| 336 | );
|
|---|
| 337 |
|
|---|
| 338 | create table fin_plata_stavka_vraboten
|
|---|
| 339 | (
|
|---|
| 340 | id int4 default nextval('fin_plata_stavka_vraboten_id_seq'::regclass) not null
|
|---|
| 341 | constraint fin_plata_stavka_vraboten_pkey
|
|---|
| 342 | primary key,
|
|---|
| 343 | plata_period_id int4 not null,
|
|---|
| 344 | vraboten_id int4 not null,
|
|---|
| 345 | vraboteni_plata_id int4 not null,
|
|---|
| 346 | bruto_vkupno numeric(14, 2) not null,
|
|---|
| 347 | neto_vkupno numeric(14, 2) not null,
|
|---|
| 348 | danoci_vkupno numeric(14, 2) not null,
|
|---|
| 349 | odbivki_vkupno numeric(14, 2) not null,
|
|---|
| 350 | vid_valuta_id int4 not null
|
|---|
| 351 | );
|
|---|
| 352 |
|
|---|
| 353 | create table fin_plata_vlez
|
|---|
| 354 | (
|
|---|
| 355 | id int4 default nextval('fin_plata_vlez_id_seq'::regclass) not null
|
|---|
| 356 | constraint fin_plata_vlez_pkey
|
|---|
| 357 | primary key,
|
|---|
| 358 | plata_period_id int4 not null,
|
|---|
| 359 | vraboten_id int4 not null,
|
|---|
| 360 | tip_platna_komponenta_id int4 not null,
|
|---|
| 361 | kvantitet numeric(12, 2),
|
|---|
| 362 | stapka numeric(14, 2),
|
|---|
| 363 | amount numeric(14, 2),
|
|---|
| 364 | izvoren_tip varchar(255)
|
|---|
| 365 | );
|
|---|
| 366 |
|
|---|
| 367 | create table fin_status_finansiska_obvrska
|
|---|
| 368 | (
|
|---|
| 369 | id int4 default nextval('fin_status_finansiska_obvrska_id_seq'::regclass) not null
|
|---|
| 370 | constraint fin_status_finansiska_obvrska_pkey
|
|---|
| 371 | primary key,
|
|---|
| 372 | kod varchar(255) not null
|
|---|
| 373 | constraint fin_status_finansiska_obvrska_kod_key
|
|---|
| 374 | unique,
|
|---|
| 375 | ime varchar(255) not null
|
|---|
| 376 | );
|
|---|
| 377 |
|
|---|
| 378 | create table fin_status_isplatna_obvrska
|
|---|
| 379 | (
|
|---|
| 380 | id int4 default nextval('fin_status_isplatna_obvrska_id_seq'::regclass) not null
|
|---|
| 381 | constraint fin_status_isplatna_obvrska_pkey
|
|---|
| 382 | primary key,
|
|---|
| 383 | kod varchar(255) not null
|
|---|
| 384 | constraint fin_status_isplatna_obvrska_kod_key
|
|---|
| 385 | unique,
|
|---|
| 386 | ime varchar(255) not null
|
|---|
| 387 | );
|
|---|
| 388 |
|
|---|
| 389 | create table fin_status_plata_period
|
|---|
| 390 | (
|
|---|
| 391 | id int4 default nextval('fin_status_plata_period_id_seq'::regclass) not null
|
|---|
| 392 | constraint fin_status_plata_period_pkey
|
|---|
| 393 | primary key,
|
|---|
| 394 | kod varchar(255) not null
|
|---|
| 395 | constraint fin_status_plata_period_kod_key
|
|---|
| 396 | unique,
|
|---|
| 397 | ime varchar(255) not null
|
|---|
| 398 | );
|
|---|
| 399 |
|
|---|
| 400 | create table fin_status_transakcija
|
|---|
| 401 | (
|
|---|
| 402 | id int4 default nextval('fin_status_transakcija_id_seq'::regclass) not null
|
|---|
| 403 | constraint fin_status_transakcija_pkey
|
|---|
| 404 | primary key,
|
|---|
| 405 | ime_status varchar(255)
|
|---|
| 406 | constraint fin_status_transakcija_ime_status_key
|
|---|
| 407 | unique
|
|---|
| 408 | );
|
|---|
| 409 |
|
|---|
| 410 | create table fin_tip_isplatna_obvrska
|
|---|
| 411 | (
|
|---|
| 412 | id int4 default nextval('fin_tip_isplatna_obvrska_id_seq'::regclass) not null
|
|---|
| 413 | constraint fin_tip_isplatna_obvrska_pkey
|
|---|
| 414 | primary key,
|
|---|
| 415 | kod varchar(255) not null
|
|---|
| 416 | constraint fin_tip_isplatna_obvrska_kod_key
|
|---|
| 417 | unique,
|
|---|
| 418 | ime varchar(255) not null
|
|---|
| 419 | );
|
|---|
| 420 |
|
|---|
| 421 | create table fin_tip_naplati_cenovnik
|
|---|
| 422 | (
|
|---|
| 423 | id int4 default nextval('fin_tip_naplati_cenovnik_id_seq'::regclass) not null
|
|---|
| 424 | constraint fin_tip_naplati_cenovnik_pkey
|
|---|
| 425 | primary key,
|
|---|
| 426 | tip_naplata_organizaciona_edinica_id int4 not null,
|
|---|
| 427 | vid_valuta_id int4 not null,
|
|---|
| 428 | iznos numeric(14, 2) not null,
|
|---|
| 429 | valid_from date not null,
|
|---|
| 430 | valid_to date,
|
|---|
| 431 | prioritet int4 default 1 not null,
|
|---|
| 432 | dozvoli_rati bool default false not null,
|
|---|
| 433 | max_rati int4,
|
|---|
| 434 | aktivna bool default true not null
|
|---|
| 435 | );
|
|---|
| 436 |
|
|---|
| 437 | create table fin_tip_naplati_organizaciona_edinica
|
|---|
| 438 | (
|
|---|
| 439 | id int4 default nextval('fin_tip_naplati_organizaciona_edinica_id_seq'::regclass) not null
|
|---|
| 440 | constraint fin_tip_naplati_organizaciona_edinica_pkey
|
|---|
| 441 | primary key,
|
|---|
| 442 | ime_tip_naplata varchar(255) not null,
|
|---|
| 443 | organizaciona_edinica_id int4 not null,
|
|---|
| 444 | aktivna bool default true not null
|
|---|
| 445 | );
|
|---|
| 446 |
|
|---|
| 447 | create table fin_tip_platna_komponenta
|
|---|
| 448 | (
|
|---|
| 449 | id int4 default nextval('fin_tip_platna_komponenta_id_seq'::regclass) not null
|
|---|
| 450 | constraint fin_tip_platna_komponenta_pkey
|
|---|
| 451 | primary key,
|
|---|
| 452 | kod varchar(255) not null
|
|---|
| 453 | constraint fin_tip_platna_komponenta_kod_key
|
|---|
| 454 | unique,
|
|---|
| 455 | ime varchar(255) not null,
|
|---|
| 456 | kategorija varchar(255) not null,
|
|---|
| 457 | default_sign int4 not null
|
|---|
| 458 | );
|
|---|
| 459 |
|
|---|
| 460 | create table fin_transakciski_smetki
|
|---|
| 461 | (
|
|---|
| 462 | id int4 default nextval('fin_transakciski_smetki_id_seq'::regclass) not null
|
|---|
| 463 | constraint fin_transakciski_smetki_pkey
|
|---|
| 464 | primary key,
|
|---|
| 465 | banka_id int4,
|
|---|
| 466 | account_holder_ime varchar(255),
|
|---|
| 467 | iban varchar(255),
|
|---|
| 468 | domestic_account_number varchar(255),
|
|---|
| 469 | routing_code varchar(255),
|
|---|
| 470 | account_type varchar(255) not null,
|
|---|
| 471 | vid_valuta_id int4 not null,
|
|---|
| 472 | aktivna bool default true not null
|
|---|
| 473 | );
|
|---|
| 474 |
|
|---|
| 475 | create table fin_vid_valuta
|
|---|
| 476 | (
|
|---|
| 477 | id int4 default nextval('fin_vid_valuta_id_seq'::regclass) not null
|
|---|
| 478 | constraint fin_vid_valuta_pkey
|
|---|
| 479 | primary key,
|
|---|
| 480 | iso_code varchar(3) not null
|
|---|
| 481 | constraint fin_vid_valuta_iso_code_key
|
|---|
| 482 | unique,
|
|---|
| 483 | ime_valuta varchar(255) not null,
|
|---|
| 484 | simbol varchar(255),
|
|---|
| 485 | decimali_kvantitet int4 default 2 not null,
|
|---|
| 486 | aktivna bool default true not null
|
|---|
| 487 | );
|
|---|
| 488 |
|
|---|
| 489 | create table gradovi
|
|---|
| 490 | (
|
|---|
| 491 | id int4 default nextval('gradovi_id_seq'::regclass) not null
|
|---|
| 492 | constraint gradovi_pkey
|
|---|
| 493 | primary key,
|
|---|
| 494 | grad_kod varchar(255),
|
|---|
| 495 | grad_ime varchar(255),
|
|---|
| 496 | drzava_id int4 not null
|
|---|
| 497 | );
|
|---|
| 498 |
|
|---|
| 499 | create table korisnici
|
|---|
| 500 | (
|
|---|
| 501 | id int4 default nextval('korisnici_id_seq'::regclass) not null
|
|---|
| 502 | constraint korisnici_pkey
|
|---|
| 503 | primary key,
|
|---|
| 504 | username varchar(255),
|
|---|
| 505 | password varchar(255),
|
|---|
| 506 | lice_id int4 not null,
|
|---|
| 507 | created_at timestamp(6),
|
|---|
| 508 | updated_at timestamp(6)
|
|---|
| 509 | );
|
|---|
| 510 |
|
|---|
| 511 | create table lice
|
|---|
| 512 | (
|
|---|
| 513 | id int4 default nextval('lice_id_seq'::regclass) not null
|
|---|
| 514 | constraint lice_pkey
|
|---|
| 515 | primary key,
|
|---|
| 516 | ime varchar(255),
|
|---|
| 517 | prezime varchar(255),
|
|---|
| 518 | datum_ragjanje date,
|
|---|
| 519 | pol varchar(255),
|
|---|
| 520 | email varchar(255),
|
|---|
| 521 | telefon varchar(255),
|
|---|
| 522 | grad_id int4 not null,
|
|---|
| 523 | aktiven bool
|
|---|
| 524 | );
|
|---|
| 525 |
|
|---|
| 526 | create table or_mapa_objekt
|
|---|
| 527 | (
|
|---|
| 528 | id int4 default nextval('or_mapa_objekt_id_seq'::regclass) not null
|
|---|
| 529 | constraint or_mapa_objekt_pkey
|
|---|
| 530 | primary key,
|
|---|
| 531 | map_object_type_id int4 not null,
|
|---|
| 532 | spatial_tekst text
|
|---|
| 533 | );
|
|---|
| 534 |
|
|---|
| 535 | create table or_mapa_objekt_organizacija
|
|---|
| 536 | (
|
|---|
| 537 | id int4 default nextval('or_mapa_objekt_organizacija_id_seq'::regclass) not null
|
|---|
| 538 | constraint or_mapa_objekt_organizacija_pkey
|
|---|
| 539 | primary key,
|
|---|
| 540 | tip_objekt_organizacija_id int4 not null,
|
|---|
| 541 | ime varchar(255),
|
|---|
| 542 | mapa_objekt_id int4 not null,
|
|---|
| 543 | organizaciona_edinica_id int4 not null,
|
|---|
| 544 | mapa_objekt_organizacija_id int4
|
|---|
| 545 | );
|
|---|
| 546 |
|
|---|
| 547 | create table or_organizaciona_edinica
|
|---|
| 548 | (
|
|---|
| 549 | id int4 default nextval('or_organizaciona_edinica_id_seq'::regclass) not null
|
|---|
| 550 | constraint or_organizaciona_edinica_pkey
|
|---|
| 551 | primary key,
|
|---|
| 552 | toe_id int4 not null,
|
|---|
| 553 | oe_id int4,
|
|---|
| 554 | ime varchar(255),
|
|---|
| 555 | mapa_objekt_id int4
|
|---|
| 556 | );
|
|---|
| 557 |
|
|---|
| 558 | create table or_organizaciona_edinica_atributi_vrednosti
|
|---|
| 559 | (
|
|---|
| 560 | id int4 default nextval('or_organizaciona_edinica_atributi_vrednosti_id_seq'::regclass) not null
|
|---|
| 561 | constraint or_organizaciona_edinica_atributi_vrednosti_pkey
|
|---|
| 562 | primary key,
|
|---|
| 563 | tip_organizaciona_edinica_atribut int4 not null,
|
|---|
| 564 | organizaciona_edinica int4 not null,
|
|---|
| 565 | string_vrednost varchar(255),
|
|---|
| 566 | numericka_vrednost numeric,
|
|---|
| 567 | boolean_vrednost bool
|
|---|
| 568 | );
|
|---|
| 569 |
|
|---|
| 570 | create table or_organizaciona_edinica_smetki
|
|---|
| 571 | (
|
|---|
| 572 | id int4 default nextval('or_organizaciona_edinica_smetki_id_seq'::regclass) not null
|
|---|
| 573 | constraint or_organizaciona_edinica_smetki_pkey
|
|---|
| 574 | primary key,
|
|---|
| 575 | organizaciona_edinica_id int4 not null,
|
|---|
| 576 | transakciska_smetka_id int4 not null,
|
|---|
| 577 | aktivna bool
|
|---|
| 578 | );
|
|---|
| 579 |
|
|---|
| 580 | create table or_tip_mapa_objekt
|
|---|
| 581 | (
|
|---|
| 582 | id int4 default nextval('or_tip_mapa_objekt_id_seq'::regclass) not null
|
|---|
| 583 | constraint or_tip_mapa_objekt_pkey
|
|---|
| 584 | primary key,
|
|---|
| 585 | name varchar(255)
|
|---|
| 586 | constraint or_tip_mapa_objekt_name_key
|
|---|
| 587 | unique
|
|---|
| 588 | );
|
|---|
| 589 |
|
|---|
| 590 | create table or_tip_objekt_organizacija
|
|---|
| 591 | (
|
|---|
| 592 | id int4 default nextval('or_tip_objekt_organizacija_id_seq'::regclass) not null
|
|---|
| 593 | constraint or_tip_objekt_organizacija_pkey
|
|---|
| 594 | primary key,
|
|---|
| 595 | ime varchar(255)
|
|---|
| 596 | );
|
|---|
| 597 |
|
|---|
| 598 | create table or_tipovi_organizaciona_edinica
|
|---|
| 599 | (
|
|---|
| 600 | id int4 default nextval('or_tipovi_organizaciona_edinica_id_seq'::regclass) not null
|
|---|
| 601 | constraint or_tipovi_organizaciona_edinica_pkey
|
|---|
| 602 | primary key,
|
|---|
| 603 | ime varchar(255)
|
|---|
| 604 | );
|
|---|
| 605 |
|
|---|
| 606 | create table or_tipovi_organizaciona_edinica_atributi
|
|---|
| 607 | (
|
|---|
| 608 | id int4 default nextval('or_tipovi_organizaciona_edinica_atributi_id_seq'::regclass) not null
|
|---|
| 609 | constraint or_tipovi_organizaciona_edinica_atributi_pkey
|
|---|
| 610 | primary key,
|
|---|
| 611 | tip_organizaciona_edinica_id int4 not null,
|
|---|
| 612 | ime varchar(255),
|
|---|
| 613 | regex varchar(255),
|
|---|
| 614 | tip_atribut_id int4 not null,
|
|---|
| 615 | zadolzitelen bool
|
|---|
| 616 | );
|
|---|
| 617 |
|
|---|
| 618 | create table sm_akademska_godina
|
|---|
| 619 | (
|
|---|
| 620 | id int4 default nextval('sm_akademska_godina_id_seq'::regclass) not null
|
|---|
| 621 | constraint sm_akademska_godina_pkey
|
|---|
| 622 | primary key,
|
|---|
| 623 | organizaciona_edinica_id int4 not null,
|
|---|
| 624 | oznaka varchar(255)
|
|---|
| 625 | constraint sm_akademska_godina_oznaka_key
|
|---|
| 626 | unique,
|
|---|
| 627 | datum_od date not null,
|
|---|
| 628 | datum_do date not null,
|
|---|
| 629 | aktivna bool default true
|
|---|
| 630 | );
|
|---|
| 631 |
|
|---|
| 632 | create table sm_akademski_semestar
|
|---|
| 633 | (
|
|---|
| 634 | id int4 default nextval('sm_akademski_semestar_id_seq'::regclass) not null
|
|---|
| 635 | constraint sm_akademski_semestar_pkey
|
|---|
| 636 | primary key,
|
|---|
| 637 | organizaciona_edinica_id int4 not null,
|
|---|
| 638 | akademska_godina_id int4 not null,
|
|---|
| 639 | tip_akademski_semestar_id int4 not null,
|
|---|
| 640 | period_akademski_semestar_id int4 not null,
|
|---|
| 641 | tip_naplata_organizaciona_edinica_id int4 not null,
|
|---|
| 642 | name varchar(255)
|
|---|
| 643 | );
|
|---|
| 644 |
|
|---|
| 645 | create table sm_akademski_semestar_smer_kvota
|
|---|
| 646 | (
|
|---|
| 647 | id int4 default nextval('sm_akademski_semestar_smer_kvota_id_seq'::regclass) not null
|
|---|
| 648 | constraint sm_akademski_semestar_smer_kvota_pkey
|
|---|
| 649 | primary key,
|
|---|
| 650 | akademski_semestar_id int4 not null,
|
|---|
| 651 | smer_verzija_id int4 not null,
|
|---|
| 652 | tip_kvota_id int4 not null,
|
|---|
| 653 | tip_naplata_oe_id int4 not null,
|
|---|
| 654 | aktivna bool default true
|
|---|
| 655 | );
|
|---|
| 656 |
|
|---|
| 657 | create table sm_akreditacija
|
|---|
| 658 | (
|
|---|
| 659 | id int4 default nextval('sm_akreditacija_id_seq'::regclass) not null
|
|---|
| 660 | constraint sm_akreditacija_pkey
|
|---|
| 661 | primary key,
|
|---|
| 662 | tip_akreditacija_id int4 not null,
|
|---|
| 663 | predmet_id int4 not null,
|
|---|
| 664 | naziv_verzija varchar(255),
|
|---|
| 665 | opis_sodrzina text,
|
|---|
| 666 | krediti int4 not null,
|
|---|
| 667 | status_akreditacija_id int4 not null,
|
|---|
| 668 | akreditacisko_telo_id int4 not null,
|
|---|
| 669 | validen_od date not null,
|
|---|
| 670 | validen_do date,
|
|---|
| 671 | broj_odluka varchar(255),
|
|---|
| 672 | aktiven bool default true
|
|---|
| 673 | );
|
|---|
| 674 |
|
|---|
| 675 | create table sm_akreditacija_fond
|
|---|
| 676 | (
|
|---|
| 677 | id int4 default nextval('sm_akreditacija_fond_id_seq'::regclass) not null
|
|---|
| 678 | constraint sm_akreditacija_fond_pkey
|
|---|
| 679 | primary key,
|
|---|
| 680 | tip_fond varchar(255),
|
|---|
| 681 | fond int4,
|
|---|
| 682 | akreditacija_id int4 not null
|
|---|
| 683 | );
|
|---|
| 684 |
|
|---|
| 685 | create table sm_akreditacija_predmet_grupa_preduslov
|
|---|
| 686 | (
|
|---|
| 687 | id int4 default nextval('sm_akreditacija_predmet_grupa_preduslov_id_seq'::regclass) not null
|
|---|
| 688 | constraint sm_akreditacija_predmet_grupa_preduslov_pkey
|
|---|
| 689 | primary key,
|
|---|
| 690 | akreditacija_id int4 not null,
|
|---|
| 691 | logicki_operator varchar(255)
|
|---|
| 692 | );
|
|---|
| 693 |
|
|---|
| 694 | create table sm_akreditacija_predmet_preduslov
|
|---|
| 695 | (
|
|---|
| 696 | id int4 default nextval('sm_akreditacija_predmet_preduslov_id_seq'::regclass) not null
|
|---|
| 697 | constraint sm_akreditacija_predmet_preduslov_pkey
|
|---|
| 698 | primary key,
|
|---|
| 699 | akreditacija_predmet_grupa_preduslov_id int4 not null,
|
|---|
| 700 | predmet_id int4,
|
|---|
| 701 | krediti_preduslov int4
|
|---|
| 702 | );
|
|---|
| 703 |
|
|---|
| 704 | create table sm_akreditacija_telo_clen
|
|---|
| 705 | (
|
|---|
| 706 | id int4 default nextval('sm_akreditacija_telo_clen_id_seq'::regclass) not null
|
|---|
| 707 | constraint sm_akreditacija_telo_clen_pkey
|
|---|
| 708 | primary key,
|
|---|
| 709 | akreditacisko_telo_id int4 not null,
|
|---|
| 710 | vraboten_angazman_id int4,
|
|---|
| 711 | tip_uloga_akreditacija_telo_id int4 not null,
|
|---|
| 712 | datum_od date,
|
|---|
| 713 | datum_do date,
|
|---|
| 714 | aktiven bool default true not null
|
|---|
| 715 | );
|
|---|
| 716 |
|
|---|
| 717 | create table sm_akreditacisko_telo
|
|---|
| 718 | (
|
|---|
| 719 | id int4 default nextval('sm_akreditacisko_telo_id_seq'::regclass) not null
|
|---|
| 720 | constraint sm_akreditacisko_telo_pkey
|
|---|
| 721 | primary key,
|
|---|
| 722 | tip_akreditacisko_telo_id int4 not null,
|
|---|
| 723 | organizaciona_edinica_id int4,
|
|---|
| 724 | ime varchar(255) not null,
|
|---|
| 725 | opis varchar(255),
|
|---|
| 726 | aktiven bool default true not null
|
|---|
| 727 | );
|
|---|
| 728 |
|
|---|
| 729 | create table sm_ispitna_sesija
|
|---|
| 730 | (
|
|---|
| 731 | id int4 default nextval('sm_ispitna_sesija_id_seq'::regclass) not null
|
|---|
| 732 | constraint sm_ispitna_sesija_pkey
|
|---|
| 733 | primary key,
|
|---|
| 734 | akademski_semestar_id int4 not null,
|
|---|
| 735 | naziv varchar(255) not null,
|
|---|
| 736 | datum_od date not null,
|
|---|
| 737 | datum_do date not null,
|
|---|
| 738 | status varchar(255)
|
|---|
| 739 | );
|
|---|
| 740 |
|
|---|
| 741 | create table sm_kurs_realizacija
|
|---|
| 742 | (
|
|---|
| 743 | id int4 default nextval('sm_kurs_realizacija_id_seq'::regclass) not null
|
|---|
| 744 | constraint sm_kurs_realizacija_pkey
|
|---|
| 745 | primary key,
|
|---|
| 746 | akreditacija_id int4 not null,
|
|---|
| 747 | akademski_semestar_id int4 not null,
|
|---|
| 748 | organizaciona_edinica_id int4 not null,
|
|---|
| 749 | kapacitet_studenti int4,
|
|---|
| 750 | minimalen_broj int4,
|
|---|
| 751 | status varchar(255)
|
|---|
| 752 | );
|
|---|
| 753 |
|
|---|
| 754 | create table sm_kurs_realizacija_nastaven_kadar
|
|---|
| 755 | (
|
|---|
| 756 | id int4 default nextval('sm_kurs_realizacija_nastaven_kadar_id_seq'::regclass) not null
|
|---|
| 757 | constraint sm_kurs_realizacija_nastaven_kadar_pkey
|
|---|
| 758 | primary key,
|
|---|
| 759 | vraboten_angazman_id int4 not null,
|
|---|
| 760 | tip_uloga_nastaven_kadar_id int4 not null,
|
|---|
| 761 | fond_casovi_nedelno numeric(5, 2),
|
|---|
| 762 | datum_od date not null,
|
|---|
| 763 | datum_do date,
|
|---|
| 764 | primaren bool default false not null,
|
|---|
| 765 | aktiven bool default true not null
|
|---|
| 766 | );
|
|---|
| 767 |
|
|---|
| 768 | create table sm_kurs_realizacija_paralelka
|
|---|
| 769 | (
|
|---|
| 770 | id int4 default nextval('sm_kurs_realizacija_paralelka_id_seq'::regclass) not null
|
|---|
| 771 | constraint sm_kurs_realizacija_paralelka_pkey
|
|---|
| 772 | primary key,
|
|---|
| 773 | kurs_realizacija_id int4 not null,
|
|---|
| 774 | oznaka varchar(255) not null,
|
|---|
| 775 | kapacitet_studenti int4 not null,
|
|---|
| 776 | aktiven bool default true
|
|---|
| 777 | );
|
|---|
| 778 |
|
|---|
| 779 | create table sm_organizaciona_edinica_diplomirani
|
|---|
| 780 | (
|
|---|
| 781 | id int4 default nextval('sm_organizaciona_edinica_diplomirani_id_seq'::regclass) not null
|
|---|
| 782 | constraint sm_organizaciona_edinica_diplomirani_pkey
|
|---|
| 783 | primary key,
|
|---|
| 784 | organizaciona_edinica_id int4 not null,
|
|---|
| 785 | student_id int4 not null,
|
|---|
| 786 | diploma_dokument_id int4 not null,
|
|---|
| 787 | smer_id int4 not null,
|
|---|
| 788 | akademska_godina_id int4 not null
|
|---|
| 789 | );
|
|---|
| 790 |
|
|---|
| 791 | create table sm_organizaciona_edinica_dostignuvanja
|
|---|
| 792 | (
|
|---|
| 793 | id int4 default nextval('sm_organizaciona_edinica_dostignuvanja_id_seq'::regclass) not null
|
|---|
| 794 | constraint sm_organizaciona_edinica_dostignuvanja_pkey
|
|---|
| 795 | primary key,
|
|---|
| 796 | organizaciona_edinica_id int4 not null,
|
|---|
| 797 | tip_dostignuvanje_id int4 not null,
|
|---|
| 798 | opis varchar(255),
|
|---|
| 799 | aktiven bool
|
|---|
| 800 | );
|
|---|
| 801 |
|
|---|
| 802 | create table sm_organizaciona_edinica_student_atributi
|
|---|
| 803 | (
|
|---|
| 804 | id int4 default nextval('sm_organizaciona_edinica_student_atributi_id_seq'::regclass) not null
|
|---|
| 805 | constraint sm_organizaciona_edinica_student_atributi_pkey
|
|---|
| 806 | primary key,
|
|---|
| 807 | organizaciona_edinica_id int4 not null,
|
|---|
| 808 | ime varchar(255),
|
|---|
| 809 | regex varchar(255),
|
|---|
| 810 | tip_atribut_id int4 not null,
|
|---|
| 811 | zadolzitelen bool
|
|---|
| 812 | );
|
|---|
| 813 |
|
|---|
| 814 | create table sm_organizaciona_edinica_student_atributi_vrednosti
|
|---|
| 815 | (
|
|---|
| 816 | id int4 default nextval('sm_organizaciona_edinica_student_atributi_vrednosti_id_seq'::regclass) not null
|
|---|
| 817 | constraint sm_organizaciona_edinica_student_atributi_vrednosti_pkey
|
|---|
| 818 | primary key,
|
|---|
| 819 | organizaciona_edinica_student_atribut int4 not null,
|
|---|
| 820 | student_id int4 not null,
|
|---|
| 821 | string_vrednost varchar(255),
|
|---|
| 822 | numericka_vrednost numeric,
|
|---|
| 823 | boolean_vrednost bool
|
|---|
| 824 | );
|
|---|
| 825 |
|
|---|
| 826 | create table sm_organizaciona_edinica_upis_pravilo
|
|---|
| 827 | (
|
|---|
| 828 | id int4 default nextval('sm_organizaciona_edinica_upis_pravilo_id_seq'::regclass) not null
|
|---|
| 829 | constraint sm_organizaciona_edinica_upis_pravilo_pkey
|
|---|
| 830 | primary key,
|
|---|
| 831 | organizaciona_edinica_id int4 not null,
|
|---|
| 832 | templejt varchar(255),
|
|---|
| 833 | validaciski_regex varchar(255),
|
|---|
| 834 | strategija varchar(255)
|
|---|
| 835 | );
|
|---|
| 836 |
|
|---|
| 837 | create table sm_paralelka_nastaven_kadar
|
|---|
| 838 | (
|
|---|
| 839 | id int4 default nextval('sm_paralelka_nastaven_kadar_id_seq'::regclass) not null
|
|---|
| 840 | constraint sm_paralelka_nastaven_kadar_pkey
|
|---|
| 841 | primary key,
|
|---|
| 842 | kurs_realizacija_paralelka_id int4 not null,
|
|---|
| 843 | kurs_realizacija_kadar_id int4 not null
|
|---|
| 844 | );
|
|---|
| 845 |
|
|---|
| 846 | create table sm_period_akademski_semestar
|
|---|
| 847 | (
|
|---|
| 848 | id int4 default nextval('sm_period_akademski_semestar_id_seq'::regclass) not null
|
|---|
| 849 | constraint sm_period_akademski_semestar_pkey
|
|---|
| 850 | primary key,
|
|---|
| 851 | ime_period varchar(255)
|
|---|
| 852 | constraint sm_period_akademski_semestar_ime_period_key
|
|---|
| 853 | unique
|
|---|
| 854 | );
|
|---|
| 855 |
|
|---|
| 856 | create table sm_predmet
|
|---|
| 857 | (
|
|---|
| 858 | id int4 default nextval('sm_predmet_id_seq'::regclass) not null
|
|---|
| 859 | constraint sm_predmet_pkey
|
|---|
| 860 | primary key,
|
|---|
| 861 | organizaciona_edinica_id int4 not null,
|
|---|
| 862 | kratenka varchar(255)
|
|---|
| 863 | constraint sm_predmet_kratenka_key
|
|---|
| 864 | unique,
|
|---|
| 865 | ime_predmet varchar(255) not null,
|
|---|
| 866 | opis text
|
|---|
| 867 | );
|
|---|
| 868 |
|
|---|
| 869 | create table sm_sistem_ocenuvanje
|
|---|
| 870 | (
|
|---|
| 871 | id int4 default nextval('sm_sistem_ocenuvanje_id_seq'::regclass) not null
|
|---|
| 872 | constraint sm_sistem_ocenuvanje_pkey
|
|---|
| 873 | primary key,
|
|---|
| 874 | organicationa_edinica_id int4 not null,
|
|---|
| 875 | ime_sistem varchar(255)
|
|---|
| 876 | );
|
|---|
| 877 |
|
|---|
| 878 | create table sm_sistem_ocenuvanje_vrednost
|
|---|
| 879 | (
|
|---|
| 880 | id int4 default nextval('sm_sistem_ocenuvanje_vrednost_id_seq'::regclass) not null
|
|---|
| 881 | constraint sm_sistem_ocenuvanje_vrednost_pkey
|
|---|
| 882 | primary key,
|
|---|
| 883 | sistem_ocenuvanje_id int4 not null,
|
|---|
| 884 | ocena_labela varchar(255),
|
|---|
| 885 | ocena_vrednost int4,
|
|---|
| 886 | polozitelna bool
|
|---|
| 887 | );
|
|---|
| 888 |
|
|---|
| 889 | create table sm_smer
|
|---|
| 890 | (
|
|---|
| 891 | id int4 default nextval('sm_smer_id_seq'::regclass) not null
|
|---|
| 892 | constraint sm_smer_pkey
|
|---|
| 893 | primary key,
|
|---|
| 894 | organizaciona_edinica_id int4 not null,
|
|---|
| 895 | ime_smer varchar(255),
|
|---|
| 896 | tip_smer_id int4 not null,
|
|---|
| 897 | akademski_stepen_id int4 not null,
|
|---|
| 898 | vid_kvalifikacija_id int4 not null,
|
|---|
| 899 | pole_kvalifikacija_id int4 not null
|
|---|
| 900 | );
|
|---|
| 901 |
|
|---|
| 902 | create table sm_smer_diplomiranje_grupa_preduslov
|
|---|
| 903 | (
|
|---|
| 904 | id int4 default nextval('sm_smer_diplomiranje_grupa_preduslov_id_seq'::regclass) not null
|
|---|
| 905 | constraint sm_smer_diplomiranje_grupa_preduslov_pkey
|
|---|
| 906 | primary key,
|
|---|
| 907 | smer_verzija_id int4 not null,
|
|---|
| 908 | logicki_operator varchar(255)
|
|---|
| 909 | );
|
|---|
| 910 |
|
|---|
| 911 | create table sm_smer_diplomiranje_preduslov
|
|---|
| 912 | (
|
|---|
| 913 | id int4 default nextval('sm_smer_diplomiranje_preduslov_id_seq'::regclass) not null
|
|---|
| 914 | constraint sm_smer_diplomiranje_preduslov_pkey
|
|---|
| 915 | primary key,
|
|---|
| 916 | smer_diplomiranje_grupa_preduslov_id int4 not null,
|
|---|
| 917 | krediti int4,
|
|---|
| 918 | organizaciona_edinica_dostignuvanje_id int4
|
|---|
| 919 | );
|
|---|
| 920 |
|
|---|
| 921 | create table sm_smer_upis_grupa_preduslov
|
|---|
| 922 | (
|
|---|
| 923 | id int4 default nextval('sm_smer_upis_grupa_preduslov_id_seq'::regclass) not null
|
|---|
| 924 | constraint sm_smer_upis_grupa_preduslov_pkey
|
|---|
| 925 | primary key,
|
|---|
| 926 | smer_verzija_id int4 not null,
|
|---|
| 927 | logicki_operator varchar(255)
|
|---|
| 928 | );
|
|---|
| 929 |
|
|---|
| 930 | create table sm_smer_upis_preduslov
|
|---|
| 931 | (
|
|---|
| 932 | id int4 default nextval('sm_smer_upis_preduslov_id_seq'::regclass) not null
|
|---|
| 933 | constraint sm_smer_upis_preduslov_pkey
|
|---|
| 934 | primary key,
|
|---|
| 935 | smer_upis_grupa_preduslov_id int4 not null,
|
|---|
| 936 | vid_kvalifikacija_id int4 not null,
|
|---|
| 937 | pole_kvalifikacija_id int4 not null
|
|---|
| 938 | );
|
|---|
| 939 |
|
|---|
| 940 | create table sm_smer_verzija
|
|---|
| 941 | (
|
|---|
| 942 | id int4 default nextval('sm_smer_verzija_id_seq'::regclass) not null
|
|---|
| 943 | constraint sm_smer_verzija_pkey
|
|---|
| 944 | primary key,
|
|---|
| 945 | smer_id int4 not null,
|
|---|
| 946 | ime_smer_verzija varchar(255),
|
|---|
| 947 | aktiven bool default true
|
|---|
| 948 | );
|
|---|
| 949 |
|
|---|
| 950 | create table sm_smer_verzija_semestar
|
|---|
| 951 | (
|
|---|
| 952 | id int4 default nextval('sm_smer_verzija_semestar_id_seq'::regclass) not null
|
|---|
| 953 | constraint sm_smer_verzija_semestar_pkey
|
|---|
| 954 | primary key,
|
|---|
| 955 | smer_verzija_id int4 not null,
|
|---|
| 956 | reden_broj int4 not null,
|
|---|
| 957 | period_akademski_semestar_id int4 not null,
|
|---|
| 958 | vkupno_ects_potrebni int4 default 30,
|
|---|
| 959 | min_izborni_krediti int4,
|
|---|
| 960 | aktiven bool default true
|
|---|
| 961 | );
|
|---|
| 962 |
|
|---|
| 963 | create table sm_smer_verzija_semestar_kurs
|
|---|
| 964 | (
|
|---|
| 965 | id int4 default nextval('sm_smer_verzija_semestar_kurs_id_seq'::regclass) not null
|
|---|
| 966 | constraint sm_smer_verzija_semestar_kurs_pkey
|
|---|
| 967 | primary key,
|
|---|
| 968 | smer_verzija_semestar_id int4 not null,
|
|---|
| 969 | akreditacija_id int4 not null,
|
|---|
| 970 | zadolzitelen bool default true not null,
|
|---|
| 971 | izborna_grupa_kod varchar(255),
|
|---|
| 972 | aktiven bool default true
|
|---|
| 973 | );
|
|---|
| 974 |
|
|---|
| 975 | create table sm_status_akreditacija
|
|---|
| 976 | (
|
|---|
| 977 | id int4 default nextval('sm_status_akreditacija_id_seq'::regclass) not null
|
|---|
| 978 | constraint sm_status_akreditacija_pkey
|
|---|
| 979 | primary key,
|
|---|
| 980 | kod varchar(255) not null
|
|---|
| 981 | constraint sm_status_akreditacija_kod_key
|
|---|
| 982 | unique,
|
|---|
| 983 | ime varchar(255) not null
|
|---|
| 984 | );
|
|---|
| 985 |
|
|---|
| 986 | create table sm_student_dostignuvanje
|
|---|
| 987 | (
|
|---|
| 988 | id int4 default nextval('sm_student_dostignuvanje_id_seq'::regclass) not null
|
|---|
| 989 | constraint sm_student_dostignuvanje_pkey
|
|---|
| 990 | primary key,
|
|---|
| 991 | organizaciona_edinica_dostignuvanje_id int4 not null,
|
|---|
| 992 | odobreno_od_vraboten_id int4 not null,
|
|---|
| 993 | student_id int4 not null,
|
|---|
| 994 | datum_postignato timestamp(6) not null,
|
|---|
| 995 | status varchar(255) not null,
|
|---|
| 996 | opis_detali varchar(255)
|
|---|
| 997 | );
|
|---|
| 998 |
|
|---|
| 999 | create table sm_student_ispit_prijava
|
|---|
| 1000 | (
|
|---|
| 1001 | id int4 default nextval('sm_student_ispit_prijava_id_seq'::regclass) not null
|
|---|
| 1002 | constraint sm_student_ispit_prijava_pkey
|
|---|
| 1003 | primary key,
|
|---|
| 1004 | student_upisan_kurs_id int4 not null,
|
|---|
| 1005 | ispitna_sesija_id int4 not null,
|
|---|
| 1006 | datum_prijava timestamp(6) not null,
|
|---|
| 1007 | status varchar(255) not null
|
|---|
| 1008 | );
|
|---|
| 1009 |
|
|---|
| 1010 | create table sm_student_ocena_zapis
|
|---|
| 1011 | (
|
|---|
| 1012 | id int4 default nextval('sm_student_ocena_zapis_id_seq'::regclass) not null
|
|---|
| 1013 | constraint sm_student_ocena_zapis_pkey
|
|---|
| 1014 | primary key,
|
|---|
| 1015 | student_upisan_kurs_id int4 not null,
|
|---|
| 1016 | ispitna_sesija_id int4 not null,
|
|---|
| 1017 | datum_zapis timestamp(6) not null,
|
|---|
| 1018 | osvoeni_poeni numeric(5, 2),
|
|---|
| 1019 | sistem_ocenuvanje_vrednost_id int4 not null,
|
|---|
| 1020 | kurs_realizacija_nastaven_kadar_id int4 not null
|
|---|
| 1021 | );
|
|---|
| 1022 |
|
|---|
| 1023 | create table sm_student_paralelka_raspredelba
|
|---|
| 1024 | (
|
|---|
| 1025 | id int4 default nextval('sm_student_paralelka_raspredelba_id_seq'::regclass) not null
|
|---|
| 1026 | constraint sm_student_paralelka_raspredelba_pkey
|
|---|
| 1027 | primary key,
|
|---|
| 1028 | student_upisan_kurs_id int4 not null,
|
|---|
| 1029 | kurs_realizacija_paralelka_id int4 not null,
|
|---|
| 1030 | datum_raspredelba timestamp(6) not null
|
|---|
| 1031 | );
|
|---|
| 1032 |
|
|---|
| 1033 | create table sm_student_semestar_upis
|
|---|
| 1034 | (
|
|---|
| 1035 | id int4 default nextval('sm_student_semestar_upis_id_seq'::regclass) not null
|
|---|
| 1036 | constraint sm_student_semestar_upis_pkey
|
|---|
| 1037 | primary key,
|
|---|
| 1038 | studenti_smerovi_id int4 not null,
|
|---|
| 1039 | akademski_semestar_id int4 not null,
|
|---|
| 1040 | smer_verzija_semestar_id int4 not null,
|
|---|
| 1041 | datum_upis timestamp(6) not null,
|
|---|
| 1042 | status varchar(255) not null
|
|---|
| 1043 | );
|
|---|
| 1044 |
|
|---|
| 1045 | create table sm_student_upisan_kurs
|
|---|
| 1046 | (
|
|---|
| 1047 | id int4 default nextval('sm_student_upisan_kurs_id_seq'::regclass) not null
|
|---|
| 1048 | constraint sm_student_upisan_kurs_pkey
|
|---|
| 1049 | primary key,
|
|---|
| 1050 | student_semestar_upis_id int4 not null,
|
|---|
| 1051 | kurs_realizacija_id int4 not null,
|
|---|
| 1052 | status_slushanje varchar(255) not null
|
|---|
| 1053 | );
|
|---|
| 1054 |
|
|---|
| 1055 | create table sm_studenti
|
|---|
| 1056 | (
|
|---|
| 1057 | id int4 default nextval('sm_studenti_id_seq'::regclass) not null
|
|---|
| 1058 | constraint sm_studenti_pkey
|
|---|
| 1059 | primary key,
|
|---|
| 1060 | user_id int4 not null,
|
|---|
| 1061 | organizaciona_edinica_id int4 not null,
|
|---|
| 1062 | indeks varchar(255),
|
|---|
| 1063 | aktiven bool default true
|
|---|
| 1064 | );
|
|---|
| 1065 |
|
|---|
| 1066 | create table sm_studenti_smerovi
|
|---|
| 1067 | (
|
|---|
| 1068 | id int4 default nextval('sm_studenti_smerovi_id_seq'::regclass) not null
|
|---|
| 1069 | constraint sm_studenti_smerovi_pkey
|
|---|
| 1070 | primary key,
|
|---|
| 1071 | student_id int4 not null,
|
|---|
| 1072 | smer_verzija_id int4 not null,
|
|---|
| 1073 | kvota_id int4 not null,
|
|---|
| 1074 | primaren bool default true,
|
|---|
| 1075 | aktiven bool default true
|
|---|
| 1076 | );
|
|---|
| 1077 |
|
|---|
| 1078 | create table sm_tip_akademski_semestar
|
|---|
| 1079 | (
|
|---|
| 1080 | id int4 default nextval('sm_tip_akademski_semestar_id_seq'::regclass) not null
|
|---|
| 1081 | constraint sm_tip_akademski_semestar_pkey
|
|---|
| 1082 | primary key,
|
|---|
| 1083 | ime_tip varchar(255)
|
|---|
| 1084 | constraint sm_tip_akademski_semestar_ime_tip_key
|
|---|
| 1085 | unique
|
|---|
| 1086 | );
|
|---|
| 1087 |
|
|---|
| 1088 | create table sm_tip_akreditacija
|
|---|
| 1089 | (
|
|---|
| 1090 | id int4 default nextval('sm_tip_akreditacija_id_seq'::regclass) not null
|
|---|
| 1091 | constraint sm_tip_akreditacija_pkey
|
|---|
| 1092 | primary key,
|
|---|
| 1093 | kod varchar(255) not null
|
|---|
| 1094 | constraint sm_tip_akreditacija_kod_key
|
|---|
| 1095 | unique,
|
|---|
| 1096 | ime varchar(255) not null
|
|---|
| 1097 | );
|
|---|
| 1098 |
|
|---|
| 1099 | create table sm_tip_akreditacisko_telo
|
|---|
| 1100 | (
|
|---|
| 1101 | id int4 default nextval('sm_tip_akreditacisko_telo_id_seq'::regclass) not null
|
|---|
| 1102 | constraint sm_tip_akreditacisko_telo_pkey
|
|---|
| 1103 | primary key,
|
|---|
| 1104 | kod varchar(255) not null
|
|---|
| 1105 | constraint sm_tip_akreditacisko_telo_kod_key
|
|---|
| 1106 | unique,
|
|---|
| 1107 | ime varchar(255) not null
|
|---|
| 1108 | );
|
|---|
| 1109 |
|
|---|
| 1110 | create table sm_tip_dostignuvanje
|
|---|
| 1111 | (
|
|---|
| 1112 | id int4 default nextval('sm_tip_dostignuvanje_id_seq'::regclass) not null
|
|---|
| 1113 | constraint sm_tip_dostignuvanje_pkey
|
|---|
| 1114 | primary key,
|
|---|
| 1115 | kod varchar(255)
|
|---|
| 1116 | constraint sm_tip_dostignuvanje_kod_key
|
|---|
| 1117 | unique,
|
|---|
| 1118 | ime varchar(255) not null,
|
|---|
| 1119 | organizaciona_edinica_id int4 not null
|
|---|
| 1120 | );
|
|---|
| 1121 |
|
|---|
| 1122 | create table sm_tip_kvota
|
|---|
| 1123 | (
|
|---|
| 1124 | id int4 default nextval('sm_tip_kvota_id_seq'::regclass) not null
|
|---|
| 1125 | constraint sm_tip_kvota_pkey
|
|---|
| 1126 | primary key,
|
|---|
| 1127 | kod varchar(255)
|
|---|
| 1128 | constraint sm_tip_kvota_kod_key
|
|---|
| 1129 | unique,
|
|---|
| 1130 | organizaciona_edinica_id int4 not null,
|
|---|
| 1131 | ime varchar(255)
|
|---|
| 1132 | );
|
|---|
| 1133 |
|
|---|
| 1134 | create table sm_tip_smer
|
|---|
| 1135 | (
|
|---|
| 1136 | id int4 default nextval('sm_tip_smer_id_seq'::regclass) not null
|
|---|
| 1137 | constraint sm_tip_smer_pkey
|
|---|
| 1138 | primary key,
|
|---|
| 1139 | ime_tip varchar(255)
|
|---|
| 1140 | constraint sm_tip_smer_ime_tip_key
|
|---|
| 1141 | unique
|
|---|
| 1142 | );
|
|---|
| 1143 |
|
|---|
| 1144 | create table sm_tip_uloga_akreditacija_telo
|
|---|
| 1145 | (
|
|---|
| 1146 | id int4 default nextval('sm_tip_uloga_akreditacija_telo_id_seq'::regclass) not null
|
|---|
| 1147 | constraint sm_tip_uloga_akreditacija_telo_pkey
|
|---|
| 1148 | primary key,
|
|---|
| 1149 | kod varchar(255) not null
|
|---|
| 1150 | constraint sm_tip_uloga_akreditacija_telo_kod_key
|
|---|
| 1151 | unique,
|
|---|
| 1152 | ime varchar(255) not null
|
|---|
| 1153 | );
|
|---|
| 1154 |
|
|---|
| 1155 | create table sm_upis_pravilo_brojac
|
|---|
| 1156 | (
|
|---|
| 1157 | id int4 default nextval('sm_upis_pravilo_brojac_id_seq'::regclass) not null
|
|---|
| 1158 | constraint sm_upis_pravilo_brojac_pkey
|
|---|
| 1159 | primary key,
|
|---|
| 1160 | pravilo_id int4 not null,
|
|---|
| 1161 | opseg_vrednost varchar(255),
|
|---|
| 1162 | posledna_sekvenca int4 default 0 not null,
|
|---|
| 1163 | updated_at timestamp(6)
|
|---|
| 1164 | );
|
|---|
| 1165 |
|
|---|
| 1166 | create table tip_atribut
|
|---|
| 1167 | (
|
|---|
| 1168 | id int4 default nextval('tip_atribut_id_seq'::regclass) not null
|
|---|
| 1169 | constraint tip_atribut_pkey
|
|---|
| 1170 | primary key,
|
|---|
| 1171 | ime varchar(255)
|
|---|
| 1172 | constraint tip_atribut_ime_key
|
|---|
| 1173 | unique
|
|---|
| 1174 | );
|
|---|
| 1175 |
|
|---|
| 1176 | create table tmp_salary_truth
|
|---|
| 1177 | (
|
|---|
| 1178 | plata_period_id int4,
|
|---|
| 1179 | vraboten_id int4,
|
|---|
| 1180 | true_bruto numeric,
|
|---|
| 1181 | true_odbivki numeric,
|
|---|
| 1182 | true_danok numeric
|
|---|
| 1183 | );
|
|---|
| 1184 |
|
|---|
| 1185 | create index idx_truth_mapping
|
|---|
| 1186 | on tmp_salary_truth (plata_period_id, vraboten_id);
|
|---|
| 1187 |
|
|---|
| 1188 | create table vr_akademski_stepen
|
|---|
| 1189 | (
|
|---|
| 1190 | id int4 default nextval('vr_akademski_stepen_id_seq'::regclass) not null
|
|---|
| 1191 | constraint vr_akademski_stepen_pkey
|
|---|
| 1192 | primary key,
|
|---|
| 1193 | ime varchar(255)
|
|---|
| 1194 | constraint vr_akademski_stepen_ime_key
|
|---|
| 1195 | unique
|
|---|
| 1196 | );
|
|---|
| 1197 |
|
|---|
| 1198 | create table vr_akademsko_zvanje
|
|---|
| 1199 | (
|
|---|
| 1200 | id int4 default nextval('vr_akademsko_zvanje_id_seq'::regclass) not null
|
|---|
| 1201 | constraint vr_akademsko_zvanje_pkey
|
|---|
| 1202 | primary key,
|
|---|
| 1203 | kod varchar(255) not null
|
|---|
| 1204 | constraint vr_akademsko_zvanje_kod_key
|
|---|
| 1205 | unique,
|
|---|
| 1206 | ime varchar(255) not null,
|
|---|
| 1207 | redosled int4,
|
|---|
| 1208 | aktivno bool default true not null
|
|---|
| 1209 | );
|
|---|
| 1210 |
|
|---|
| 1211 | create table vr_lice_kvalifikacija
|
|---|
| 1212 | (
|
|---|
| 1213 | id int4 default nextval('vr_lice_kvalifikacija_id_seq'::regclass) not null
|
|---|
| 1214 | constraint vr_lice_kvalifikacija_pkey
|
|---|
| 1215 | primary key,
|
|---|
| 1216 | lice_id int4 not null,
|
|---|
| 1217 | vid_kvalifikacija_id int4 not null,
|
|---|
| 1218 | pole_kvalifikacija_id int4,
|
|---|
| 1219 | naziv_kvalifikacija varchar(255) not null,
|
|---|
| 1220 | institucija_izdavac varchar(255),
|
|---|
| 1221 | drzava_id int4 not null,
|
|---|
| 1222 | datum_izdavanje date,
|
|---|
| 1223 | dokument_url varchar(255)
|
|---|
| 1224 | );
|
|---|
| 1225 |
|
|---|
| 1226 | create table vr_pole_kvalifikacija
|
|---|
| 1227 | (
|
|---|
| 1228 | id int4 default nextval('vr_pole_kvalifikacija_id_seq'::regclass) not null
|
|---|
| 1229 | constraint vr_pole_kvalifikacija_pkey
|
|---|
| 1230 | primary key,
|
|---|
| 1231 | kod varchar(255) not null
|
|---|
| 1232 | constraint vr_pole_kvalifikacija_kod_key
|
|---|
| 1233 | unique,
|
|---|
| 1234 | ime varchar(255) not null
|
|---|
| 1235 | );
|
|---|
| 1236 |
|
|---|
| 1237 | create table vr_pozicija_preduslov
|
|---|
| 1238 | (
|
|---|
| 1239 | id int4 default nextval('vr_pozicija_preduslov_id_seq'::regclass) not null
|
|---|
| 1240 | constraint vr_pozicija_preduslov_pkey
|
|---|
| 1241 | primary key,
|
|---|
| 1242 | pozicija_preduslov_grupa_id int4 not null,
|
|---|
| 1243 | tip_preduslov varchar(255) not null,
|
|---|
| 1244 | minimalen_akademski_stepen_id int4,
|
|---|
| 1245 | vid_kvalifikacija_id int4,
|
|---|
| 1246 | pole_kvalifikacija_id int4,
|
|---|
| 1247 | min_godini_iskustvo int4,
|
|---|
| 1248 | obvrzna_verifikacija bool default false not null,
|
|---|
| 1249 | zadolzitelen bool default true not null
|
|---|
| 1250 | );
|
|---|
| 1251 |
|
|---|
| 1252 | create table vr_pozicija_preduslov_grupa
|
|---|
| 1253 | (
|
|---|
| 1254 | id int4 default nextval('vr_pozicija_preduslov_grupa_id_seq'::regclass) not null
|
|---|
| 1255 | constraint vr_pozicija_preduslov_grupa_pkey
|
|---|
| 1256 | primary key,
|
|---|
| 1257 | rabota_pozicija_id int4 not null,
|
|---|
| 1258 | logicki_operator varchar(255) not null
|
|---|
| 1259 | );
|
|---|
| 1260 |
|
|---|
| 1261 | create table vr_rabota_pozicija
|
|---|
| 1262 | (
|
|---|
| 1263 | id int4 default nextval('vr_rabota_pozicija_id_seq'::regclass) not null
|
|---|
| 1264 | constraint vr_rabota_pozicija_pkey
|
|---|
| 1265 | primary key,
|
|---|
| 1266 | tip_organizaciona_edinica_id int4 not null,
|
|---|
| 1267 | kod_pozicija varchar(255) not null,
|
|---|
| 1268 | ime_pozicija varchar(255) not null,
|
|---|
| 1269 | kategorija varchar(255),
|
|---|
| 1270 | aktivna bool default true not null
|
|---|
| 1271 | );
|
|---|
| 1272 |
|
|---|
| 1273 | create table vr_status_vrabotenje
|
|---|
| 1274 | (
|
|---|
| 1275 | id int4 default nextval('vr_status_vrabotenje_id_seq'::regclass) not null
|
|---|
| 1276 | constraint vr_status_vrabotenje_pkey
|
|---|
| 1277 | primary key,
|
|---|
| 1278 | kod varchar(255) not null
|
|---|
| 1279 | constraint vr_status_vrabotenje_kod_key
|
|---|
| 1280 | unique,
|
|---|
| 1281 | ime varchar(255) not null
|
|---|
| 1282 | );
|
|---|
| 1283 |
|
|---|
| 1284 | create table vr_tip_angazman
|
|---|
| 1285 | (
|
|---|
| 1286 | id int4 default nextval('vr_tip_angazman_id_seq'::regclass) not null
|
|---|
| 1287 | constraint vr_tip_angazman_pkey
|
|---|
| 1288 | primary key,
|
|---|
| 1289 | kod varchar(255) not null
|
|---|
| 1290 | constraint vr_tip_angazman_kod_key
|
|---|
| 1291 | unique,
|
|---|
| 1292 | ime varchar(255) not null
|
|---|
| 1293 | );
|
|---|
| 1294 |
|
|---|
| 1295 | create table vr_tip_funkcija
|
|---|
| 1296 | (
|
|---|
| 1297 | id int4 default nextval('vr_tip_funkcija_id_seq'::regclass) not null
|
|---|
| 1298 | constraint vr_tip_funkcija_pkey
|
|---|
| 1299 | primary key,
|
|---|
| 1300 | kod varchar(255) not null
|
|---|
| 1301 | constraint vr_tip_funkcija_kod_key
|
|---|
| 1302 | unique,
|
|---|
| 1303 | ime varchar(255) not null,
|
|---|
| 1304 | mandatna bool default false not null
|
|---|
| 1305 | );
|
|---|
| 1306 |
|
|---|
| 1307 | create table vr_tip_organizaciona_uloga
|
|---|
| 1308 | (
|
|---|
| 1309 | id int4 default nextval('vr_tip_organizaciona_uloga_id_seq'::regclass) not null
|
|---|
| 1310 | constraint vr_tip_organizaciona_uloga_pkey
|
|---|
| 1311 | primary key,
|
|---|
| 1312 | kod varchar(255) not null
|
|---|
| 1313 | constraint vr_tip_organizaciona_uloga_kod_key
|
|---|
| 1314 | unique,
|
|---|
| 1315 | ime varchar(255) not null,
|
|---|
| 1316 | opis varchar(255)
|
|---|
| 1317 | );
|
|---|
| 1318 |
|
|---|
| 1319 | create table vr_tip_uloga_nastaven_kadar
|
|---|
| 1320 | (
|
|---|
| 1321 | id int4 default nextval('vr_tip_uloga_nastaven_kadar_id_seq'::regclass) not null
|
|---|
| 1322 | constraint vr_tip_uloga_nastaven_kadar_pkey
|
|---|
| 1323 | primary key,
|
|---|
| 1324 | kod varchar(255) not null
|
|---|
| 1325 | constraint vr_tip_uloga_nastaven_kadar_kod_key
|
|---|
| 1326 | unique,
|
|---|
| 1327 | ime varchar(255) not null
|
|---|
| 1328 | );
|
|---|
| 1329 |
|
|---|
| 1330 | create table vr_vid_kvalifikacija
|
|---|
| 1331 | (
|
|---|
| 1332 | id int4 default nextval('vr_vid_kvalifikacija_id_seq'::regclass) not null
|
|---|
| 1333 | constraint vr_vid_kvalifikacija_pkey
|
|---|
| 1334 | primary key,
|
|---|
| 1335 | kod varchar(255) not null
|
|---|
| 1336 | constraint vr_vid_kvalifikacija_kod_key
|
|---|
| 1337 | unique,
|
|---|
| 1338 | ime varchar(255) not null,
|
|---|
| 1339 | akademski_stepen_id int4 not null
|
|---|
| 1340 | );
|
|---|
| 1341 |
|
|---|
| 1342 | create table vr_vraboten_akademsko_zvanje
|
|---|
| 1343 | (
|
|---|
| 1344 | id int4 default nextval('vr_vraboten_akademsko_zvanje_id_seq'::regclass) not null
|
|---|
| 1345 | constraint vr_vraboten_akademsko_zvanje_pkey
|
|---|
| 1346 | primary key,
|
|---|
| 1347 | vraboten_angazman_id int4 not null,
|
|---|
| 1348 | akademsko_zvanje_id int4 not null,
|
|---|
| 1349 | datum_od date not null,
|
|---|
| 1350 | datum_do date,
|
|---|
| 1351 | dokument_id int4,
|
|---|
| 1352 | aktivno bool default true not null
|
|---|
| 1353 | );
|
|---|
| 1354 |
|
|---|
| 1355 | create table vr_vraboten_angazman
|
|---|
| 1356 | (
|
|---|
| 1357 | id int4 default nextval('vr_vraboten_angazman_id_seq'::regclass) not null
|
|---|
| 1358 | constraint vr_vraboten_angazman_pkey
|
|---|
| 1359 | primary key,
|
|---|
| 1360 | lice_id int4 not null,
|
|---|
| 1361 | organizaciona_edinica_id int4 not null,
|
|---|
| 1362 | rabota_pozicija_id int4 not null,
|
|---|
| 1363 | status_vrabotenje_id int4 not null,
|
|---|
| 1364 | tip_angazman_id int4 not null,
|
|---|
| 1365 | datum_od date not null,
|
|---|
| 1366 | datum_do date,
|
|---|
| 1367 | primaren bool default true not null,
|
|---|
| 1368 | fte numeric(5, 2),
|
|---|
| 1369 | nadreden_angazman_id int4,
|
|---|
| 1370 | aktiven bool default true not null
|
|---|
| 1371 | );
|
|---|
| 1372 |
|
|---|
| 1373 | create table vr_vraboten_funkcija
|
|---|
| 1374 | (
|
|---|
| 1375 | id int4 default nextval('vr_vraboten_funkcija_id_seq'::regclass) not null
|
|---|
| 1376 | constraint vr_vraboten_funkcija_pkey
|
|---|
| 1377 | primary key,
|
|---|
| 1378 | vraboten_angazman_id int4 not null,
|
|---|
| 1379 | tip_funkcija_id int4 not null,
|
|---|
| 1380 | organizaciona_edinica_id int4 not null,
|
|---|
| 1381 | datum_od date not null,
|
|---|
| 1382 | datum_do date,
|
|---|
| 1383 | dokument_id int4,
|
|---|
| 1384 | aktivna bool default true not null
|
|---|
| 1385 | );
|
|---|
| 1386 |
|
|---|
| 1387 | create table vr_vraboten_kompensacija
|
|---|
| 1388 | (
|
|---|
| 1389 | id int4 default nextval('vr_vraboten_kompensacija_id_seq'::regclass) not null
|
|---|
| 1390 | constraint vr_vraboten_kompensacija_pkey
|
|---|
| 1391 | primary key,
|
|---|
| 1392 | vraboten_angazman_id int4 not null,
|
|---|
| 1393 | valid_from date not null,
|
|---|
| 1394 | valid_to date,
|
|---|
| 1395 | tip_osnova varchar(255) not null,
|
|---|
| 1396 | bruto_osnova numeric(14, 2),
|
|---|
| 1397 | neto_osnova numeric(14, 2),
|
|---|
| 1398 | vid_valuta_id int4 not null,
|
|---|
| 1399 | fond_casovi numeric(10, 2),
|
|---|
| 1400 | aktivna bool default true not null
|
|---|
| 1401 | );
|
|---|
| 1402 |
|
|---|
| 1403 | create table vr_vraboten_organizaciona_uloga
|
|---|
| 1404 | (
|
|---|
| 1405 | id int4 default nextval('vr_vraboten_organizaciona_uloga_id_seq'::regclass) not null
|
|---|
| 1406 | constraint vr_vraboten_organizaciona_uloga_pkey
|
|---|
| 1407 | primary key,
|
|---|
| 1408 | vraboten_angazman_id int4 not null,
|
|---|
| 1409 | tip_organizaciona_uloga_id int4 not null,
|
|---|
| 1410 | organizaciona_edinica_id int4 not null,
|
|---|
| 1411 | datum_od date not null,
|
|---|
| 1412 | datum_do date,
|
|---|
| 1413 | aktivna bool default true not null
|
|---|
| 1414 | );
|
|---|