options: type: InnoDB collate: utf8_unicode_ci charset: utf8 Admin: actAs: [Timestampable] columns: id: { type: integer, primary: true, autoincrement: true } prih_jmeno: { type: string(255) } prih_heslo: { type: string(255) } jmeno: { type: string(255) } uroven: { type: enum, values: [god, lektor, vkladatel], default: vkladatel } Test: actAs: [SoftDelete, TimeStampable] columns: id: { type: integer, primary: true, autoincrement: true } admin_id: { type: integer } unikatni_nazev: { type: string(255), unique: true, notnull: true } nazev_testu: { type: string(255), notnull: true } cas: { type: integer(3), notnull: true } instrukce: { type: clob } kriteria: { type: clob } archive: { type: integer, notnull: true, default: 0 } relations: Admin: { local: admin_id, foreign: id } Test_cviceni: actAs: [Timestampable] columns: admin_id: { type: integer } cviceni_id: { type: integer } test_id: { type: integer } poradi: { type: integer } pocet_otazek: { type: integer } bodu_na_otazku: type: decimal(3) scale: 1 default: '1.0' notnull: true relations: Admin: { local: admin_id, foreign: id } Cviceni: { local: cviceni_id, foreign: id, foreignAlias: Testy } Test: { local: test_id, foreign: id, foreignAlias: Cviceni } Specifikace_cviceni: columns: id: { type: integer, primary: true, autoincrement: true } typ: { type: enum, values: [spolecnost, pokrocilost, specializace, gramatika, fraze] } skupina: { type: string(255) } hodnota: { type: string(255) } Cviceni: actAs: [Timestampable, SoftDelete] columns: id: { type: integer, primary: true, autoincrement: true } admin_id: { type: integer } specifikace_spolecnost: { type: string(255) } specifikace_pokrocilost: { type: string(255) } specifikace_specializace: { type: string(255) } specifikace_gramatika: { type: string(255) } specifikace_fraze: { type: string(255) } typ: { type: integer(1) } nazev: { type: string(255), notnull: true, unique: true } zadani: { type: clob } relations: Admin: { local: admin_id, foreign: id } Otazky: actAs: Timestampable: columns: id: type: integer primary: true autoincrement: true cviceni_id: type: integer notnull: true text: type: clob notnull: true uvod: type: clob relations: Cviceni: local: cviceni_id foreign: id foreignAlias: Otazky Test_zakaznik: actAs: Timestampable: SoftDelete: columns: id: type: integer primary: true autoincrement: true test_id: type: integer notnull: true admin_id: integer zakaznik_id: type: integer notnull: true hodnoceni_head_id: type: integer relations: Test: local: test_id foreign: id foreignAlias: TestZakaznik Admin: local: admin_id foreign: id Zakaznik: local: zakaznik_id foreign: id foreignAlias: TestZakaznik Hodnoceni_head: local: hodnoceni_head_id foreign: id Zavora: actAs: Timestampable: columns: zakaznik_id: {type: integer, notnull: true} datum: {type: date, notnull: true} relations: Zakaznik: {onDelete: CASCADE, local: zakaznik_id, foreign: id, foreignAlias: Zavory, type: one, foreignType: many } Zakaznik: actAs: Timestampable: columns: id: type: integer primary: true autoincrement: true hlavicka: clob nazev: type: string(255) notnull: true datum_do: timestamp email: string(255) barvy: clob logo: string(255) instrukce: string(255) email_vysledek: clob email_vysledek_predmet: {type: string(255), notnull: true, default: 'Výsledek Vašeho testu' } email_kod: clob email_kod_predmet: {type: string(255), notnull: true, default: 'Testování znalostí jazyků - odkaz na test' } # Whiski - nepoužívá se, asi pozůstatek nějaké myšlenky: email_personalista: clob email_hlavicka_vysledek: string(255) email_hlavicka_kod: string(255) email_hlavicka_personalista: string(255) # eof Whiski Personalista: actAs: Timestampable: columns: id: type: integer primary: true autoincrement: true zakaznik_id: type: integer notnull: true prih_heslo: type: string(255) notnull: true jmeno: type: string(255) notnull: true email: type: string(255) notnull: true pro_pracovniky: type: boolean default: true notnull: true relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Personalista_list Uchazec: actAs: Timestampable: columns: id: type: integer primary: true autoincrement: true personalista_id: type: integer notnull: false pracovnik_id: type: integer notnull: false kurz_beh_id: type: integer notnull: false test_zakaznik_id: integer vlna_id: integer zakaznik_id: integer jmeno: type: string(255) notnull: true email: type: string(255) notnull: false kod: type: string(20) unique: true datum_prihlaseni: type: timestamp datum_startu: type: timestamp datum_ukonceni: type: timestamp archiv: type: boolean default: false uspesnost: type: integer(4) default: 0 odeslani_emailu: type: integer(1) test_nazev: { type: string(255), notnull: true } test_cas: { type: integer(3), notnull: true } test_instrukce: { type: clob } test_kriteria: { type: clob } kod_odeslan: {type: timestamp, notnull: false} user_ip: { type: string(255) } user_browser: { type: clob } relations: Personalista: local: personalista_id foreign: id foreignAlias: Uchazec_list Test_zakaznik: local: test_zakaznik_id foreign: id foreignAlias: Uchazec Vlna: local: vlna_id foreign: id foreignAlias: Uchazeci Zakaznik: local: zakaznik_id foreign: id foreignAlias: Uchazec Pracovnik: local: pracovnik_id foreign: id foreignAlias: Uchazec_list Kurz_beh: local: kurz_beh_id foreign: id foreignAlias: Uchazec_list Uchazec_text: columns: id: type: integer primary: true autoincrement: true uchazec_id: integer cviceni_id: integer otazka_id: integer zdroj_otazka: type: clob notnull: false zadani: clob odpoved: clob spravne: integer datum_vytvoreni: timestamp datum_zodpovezeni: timestamp datum_posledni_zmeny: timestamp pocet_zodpovezeni: integer bodu_na_otazku: { type: decimal(3), scale: 1 } spravne_gramatika: { type: string(255) } spatne_gramatika: { type: string(255) } user_ip: { type: string(255) } user_browser: { type: clob } relations: Uchazec: local: uchazec_id foreign: id foreignAlias: Uchazec_text onDelete: CASCADE Cviceni: local: cviceni_id foreign: id Otazky: local: otazka_id foreign: id foreignAlias: Uchazec_text Hodnoceni_head: columns: nazev: { type: string(255), notnull: true } Hodnoceni: columns: head_id: { type: integer, notnull: true } procenta_do: { type: integer(3), notnull: true } hodnoceni: { type: string(255), notnull: true } hodnoceni_text: { type: clob } relations: Hodnoceni_head: local: head_id foreign: id foreignAlias: Hodnoceni_list Gramatika: columns: kod: { type: string(255), notnull: true} popis: { type: string(255), notnull: true} popis_full: { type: clob } hodnoceni_head_id: { type: integer, notnull: true } jazyk_id: { type: integer, notnull: false } kategorie_id: { type: integer, notnull: false } priorita: { type: integer, notnull: true, default: 100 } relations: Hodnoceni_head: { local: hodnoceni_head_id, foreign: id } Jazyk: { class: Jazyk_gramatiky, onDelete: CASCADE, local: jazyk_id, foreign: id, foreignAlias: Gramatiky, type: one, foreignType: many } Kategorie: { class: Kategorie_gramatiky, onDelete: CASCADE, local: kategorie_id, foreign: id, foreignAlias: Gramatiky, type: one, foreignType: many } Jazyk_gramatiky: columns: nazev: { type: string(255), notnull: true, unique: true } Kategorie_gramatiky: columns: nazev: { type: string(255), notnull: true, unique: true } # # verze 2 - pracovnici, kurzy, dochazka # Pomocnici_personalisty: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } min_dochazka: { type: integer } min_uspesnost: { type: integer } min_spokojenost: { type: integer } min_hranice: { type: integer } email_prekroceni: { type: integer } email_nevyplneni: { type: integer } email_zp: { type: integer } min_dochazka_a: { type: integer, notnull: false } min_uspesnost_a: { type: integer, notnull: false } min_spokojenost_a: { type: integer, notnull: false } min_hranice_a: { type: integer, notnull: false } min_dochazka_date: { type: string(255), notnull: false } min_uspesnost_date: { type: string(255), notnull: false } min_spokojenost_date: { type: string(255), notnull: false } min_hranice_date: { type: string(255), notnull: false } email_trkniha_mesicne: {type: boolean, notnull: true, default: false} #k tomuto dni každý měsíc půjdou emaily email_trkniha_mesicne_ke_dni: {type: integer, notnull: false} email_dokumenty: {type: boolean, notnull: true, default: false} relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Pomocnici_personalisty_list Pracovnik: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } personalista_id: { type: integer, notnull: false } specifikace_pracovnik: { type: string(255) } jmeno: { type: string(255), notnull: true } prijmeni: { type: string(255), notnull: true } email: { type: string(255) } pozice: { type: string(255) } osobni_cislo: { type: string(255) } nakladove_stredisko: { type: string(255) } oddeleni: { type: string(255) } nadrizeny: { type: string(255) } poznamka: { type: clob } heslo: { type: string(255) } pristup_app_pracovnik: { type: boolean, notnull: true, default: false } vidi_strediska: { type: string(255) } vidi_celou_dochazku: { type: boolean, notnull: true, default: false } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Pracovnik_list VidiKurzy: { class: Kurz, foreignAlias: VidiPracovnici, refClass: PracovnikVidiKurz, local: pracovnik_id, foreign: kurz_id } Personalista: { onDelete: SET NULL, local: personalista_id, foreign: id, foreignAlias: Pracovnici, type: one, foreignType: many } actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" PracovnikVidiKurz: columns: pracovnik_id: { type: integer, notnull: true } kurz_id: { type: integer, notnull: true } relations: Pracovnik: { onDelete: CASCADE, local: pracovnik_id, foreign: id, foreignAlias: VidiKurzyRelace, type: one, foreignType: many } Kurz: { onDelete: CASCADE, local: kurz_id, foreign: id, foreignAlias: VidiPracovniciRelace, type: one, foreignType: many } Pracovnik_rozpocet: columns: id: { type: integer, primary: true, autoincrement: true } pracovnik_id: { type: integer, notnull: true } kurz_beh_id: { type: integer, notnull: true } rozpocet: { type: decimal } cerpano: { type: decimal } relations: Pracovnik: local: pracovnik_id foreign: id foreignAlias: Rozpocet_list Kurz_beh: local: kurz_beh_id foreign: id foreignAlias: Rozpocet_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Specifikace_pracovnik: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } pozice: { type: integer, notnull: true} hodnota: { type: string(255) } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: SpecifikacePracovniku Agentura: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } nazev: { type: string(255), notnull: true } email: { type: string(255) } login: { type: string(255)} heslo: { type: string(255), notnull: true } poznamka: { type: clob } language: { type: enum, values: [ cs, en], default: cs } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Agentury actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Lektor: columns: jmeno: { type: string(255), notnull: true } prijmeni: { type: string(255), notnull: true } email: { type: string(255) } telefon: { type: string(255) } specializace: { type: string(255) } poznamka: { type: clob } agentura_id: { type: integer, notnull: true } relations: Agentura: local: agentura_id foreign: id foreignAlias: Lektor_list Kurz: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } specifikace_kurz: { type: string(255) } typ: { type: enum, values: [individualni, hromadny], default: individualni } nazev: { type: string(255), notnull: true } poznamka: { type: clob } oddeleni: { type: string(100), notnull: true } lokalita: { type: string(255), notnull: true } nakladove_stredisko: { type: string(255)} typ_komplex: { type: enum, values: [jk, kkp, kka, dk], default: kka } report_trkniha: {type: boolean, notnull: false, default: true} relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Kurz_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Specifikace_kurzu: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } poradi: { type: integer, default: 1000 } hodnota: { type: string(255) } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: SpecifikaceKurzu Pracovnik_kurz: columns: id: { type: integer, primary: true, autoincrement: true } pracovnik_id: { type: integer, notnull: true } kurz_id: { type: integer, notnull: true } relations: Pracovnik: local: pracovnik_id foreign: id foreignAlias: Pracovnik_kurz_list Kurz: local: kurz_id foreign: id foreignAlias: Pracovnik_kurz_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Pracovnik_kurz_hodnoceni: columns: id: { type: integer, primary: true, autoincrement: true } pracovnik_id: { type: integer, notnull: true } kurz_id: { type: integer, notnull: true } datum: { type: date } lektor: { type: string(255) } hodnoceni: { type: clob } relations: Pracovnik: local: pracovnik_id foreign: id foreignAlias: Pracovnik_kurz_hodnoceni_list Kurz: local: kurz_id foreign: id foreignAlias: Pracovnik_kurz_hodnoceni_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Kurz_beh: columns: id: { type: integer, primary: true, autoincrement: true } kurz_id: { type: integer} agentura_id: { type: integer} beh_od: { type: date } beh_do: { type: date } poznamka: { type: clob } pokrocilost: { type: string(255) } tema: { type: clob } fj_meritko: { type: enum, values: [null,beh_kurzu, den, minuty] } fj_hodnota: { type: integer } fj_tydne: { type: integer } fj_cena: { type: decimal(10), scale: 2 } dotace: { type: string(100) } lektor_id: { type: integer } relations: Kurz: local: kurz_id foreign: id foreignAlias: Kurz_beh_list Agentura: local: agentura_id foreign: id foreignAlias: Kurz_beh_list Lektor: local: lektor_id foreign: id foreignAlias: Kurz_beh_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Mistnost: columns: budova: { type: string(255) } patro: { type: string(255) } mistnost: { type: string(255) } poznamka: { type: clob } zakaznik_id: { type: integer } barva: { type: string(255), notnull: true, default: bcbcbc } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Mistnost_list Kurz_beh_testy: columns: id: { type: integer, primary: true, autoincrement: true } kurz_beh_id: { type: integer, notnull: true } test_id: { type: integer, notnull: true } relations: Kurz_beh: local: kurz_beh_id foreign: id foreignAlias: Kurz_beh_test_list Test: local: test_id foreign: id foreignAlias: Kurz_beh_test_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Kurz_hodina: columns: id: { type: integer, primary: true, autoincrement: true } kurz_beh_id: { type: integer, notnull: true } datum: { type: date, notnull: true } zruseno: { type: enum, values: [ne, pozde, agentura, vcas], notnull: true } tema: { type: clob, notnull: true } ucebnice: { type: string(255) } kapitola: { type: string(255) } strana: { type: string(255) } gramatika: { type: string(255) } slovni_zasoba: { type: string(255) } poznamka: { type: clob } relations: Kurz_beh: local: kurz_beh_id foreign: id foreignAlias: Kurz_hodina_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Kurz_dochazka: columns: id: { type: integer, primary: true, autoincrement: true } pracovnik_id: { type: integer, notnull: true } kurz_hodina_id: { type: integer, notnull: true } cena: { type: decimal } stav: { type: enum, values: [ 'A', 'N', 'ZP', 'ZA', 'ZV' ] } relations: Kurz_hodina: local: kurz_hodina_id foreign: id foreignAlias: Dochazka_list onDelete: CASCADE Pracovnik: local: pracovnik_id foreign: id foreignAlias: Dochazka_list actAs: Archivable: expression: symfony_context: "getUser()->getAttribute('archive_level')" Kurz_rozvrh: columns: kurz_id: { type: integer, notnull: true } # 0 - Neděle .. 6 - Sobota den_v_tydnu: { type: integer(1) } od: { type: time } do: { type: time } mistnost_id: { type: integer } poznamka: { type: clob } relations: Kurz: local: kurz_id foreign: id foreignAlias: Kurz_rozvrh_list Mistnost: local: mistnost_id foreign: id foreignAlias: Kurz_rozvrh_list Moduly_zakaznik: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } modul: { type: string(255), notnull: true } relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Moduly_zakaznik_list Dotaznik: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } personalista_id: { type: integer, notnull: true } nazev: { type: string(255), notnull: true} uvod_text: { type: clob, notnull: true } email_hlavicka: { type: clob, notnull: true } email_text: { type: clob, notnull: true } email_personalista: { type: boolean, notnull: true, default: false } zasilat_upominku: { type: boolean, notnull: true, default: false } zasilat_upominku_dni_predem: { type: integer } text_upominky: { type: clob, notnull: true } policajt: { type: float } zobrazit_vysledky_agenture: { type: boolean, notnull: true, default: false} datum_do: { type: timestamp } typ: { type: enum, values: [vahove, procento] } kod: type: string(20) unique: true relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Dotaznik_list Personalista: local: personalista_id foreign: id foreignAlias: Dotaznik_list Kurzy: { class: Kurz, foreignAlias: Dotazniky, refClass: DotaznikKurz, local: dotaznik_id, foreign: kurz_id } Pracovnici: { class: Pracovnik, foreignAlias: Dotazniky, refClass: Dotaznik_pracovnik, local: dotaznik_id, foreign: pracovnik_id } Dotaznik_otazka: columns: id: { type: integer, primary: true, autoincrement: true } dotaznik_id: { type: integer, notnull: true } text_otazka: { type: string, notnull: true} typ: { type: integer } relations: Dotaznik: local: dotaznik_id foreign: id foreignAlias: Dotaznik_otazka_list Dotaznik_otazka_odpoved: columns: id: { type: integer, primary: true, autoincrement: true } dotaznik_otazka_id: { type: integer, notnull: true } text_odpoved: { type: string, notnull: true} body: { type: string(255), notnull: true} relations: Dotaznik_otazka: local: dotaznik_otazka_id foreign: id foreignAlias: Dotaznik_otazka_odpoved_list Dotaznik_pracovnik_odpoved: columns: id: { type: integer, primary: true, autoincrement: true } dotaznik_otazka_id: { type: integer, notnull: true } pracovnik_id: { type: integer, notnull: true } odpoved: { type: string} body: { type: string(255)} relations: Dotaznik_otazka: local: dotaznik_otazka_id foreign: id foreignAlias: Dotaznik_pracovnik_odpoved_list Pracovnik: local: pracovnik_id foreign: id foreignAlias: Dotaznik_pracovnik_odpoved_list Dotaznik_pracovnik: columns: id: { type: integer, primary: true, autoincrement: true } dotaznik_id: { type: integer, notnull: true } pracovnik_id: { type: integer, notnull: true } kurz_id: { type: integer, notnull: false } dokonceno: { type: integer } code_send_date: { type: timestamp, notnull: false } relations: Dotaznik: local: dotaznik_id foreign: id foreignAlias: Dotaznik_pracovnik_list Pracovnik: local: pracovnik_id foreign: id foreignAlias: Dotaznik_pracovnik_list DotaznikKurz: columns: dotaznik_id: { type: integer, primary: true } kurz_id: { type: integer, primary: true } relations: Dotaznik: { onDelete: CASCADE, local: dotaznik_id, foreign: id, foreignAlias: KurzRelations, type: one, foreignType: many } Kurz: { onDelete: CASCADE, local: kurz_id, foreign: id, foreignAlias: DotaznikRelations, type: one, foreignType: many } Agentura_beh_soubor: columns: id: { type: integer, primary: true, autoincrement: true } kurz_beh_id: { type: integer, notnull: true } soubor: string(255) nazev: { type: string(255), notnull: true } relations: Kurz_beh: local: kurz_beh_id foreign: id foreignAlias: Agentura_beh_soubor Vlna: columns: id: { type: integer, primary: true, autoincrement: true } zakaznik_id: { type: integer, notnull: true } test_zakaznik_id: { type: integer, notnull: true } nazev: { type: string(255), notnull: true } email_vysledek_pouzit_z_vlny: { type: boolean, notnull: true, default: false } email_vysledek_predmet: {type: string(255), notnull: true, default: 'Výsledek Vašeho testu' } email_vysledek: clob email_kod_pouzit_z_vlny: { type: boolean, notnull: true, default: false } email_kod_predmet: {type: string(255), notnull: true, default: 'Testování znalostí jazyků - odkaz na test' } email_kod: clob relations: Zakaznik: local: zakaznik_id foreign: id foreignAlias: Vlny Test_zakaznik: local: test_zakaznik_id foreign: id foreignAlias: Vlny #ALTER TABLE `kurz_beh` ADD `lektor_id` BIGINT NULL DEFAULT NULL AFTER `dotace` ; #ALTER TABLE `lektor` ADD `prijmeni` VARCHAR( 255 ) NOT NULL AFTER `jmeno` Document: actAs: Timestampable: ~ Sluggable: fields: [name] unique: true builder: ['saInflector', 'urlize'] columns: zakaznik_id: { type: integer, notnull: true } parent_id: { type: integer, notnull: false } kurz_id: { type: integer, notnull: false } beh_id: { type: integer, notnull: false } pracovnik_id: { type: integer, notnull: false } agentura_id: { type: integer, notnull: false } hodina_id: { type: integer, notnull: false } name: { type: string(255), notnull: true } is_dir: { type: boolean, notnull: true, default: false } is_global: { type: boolean, notnull: true, default: false } filename: { type: string(255), notnull: false } agentura_read: { type: boolean, notnull: true, default: false } agentura_write: { type: boolean, notnull: true, default: false } relations: Zakaznik: { onDelete: CASCADE, local: zakaznik_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } Kurz: { onDelete: CASCADE, local: kurz_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } Beh: { onDelete: CASCADE, class: Kurz_beh, local: beh_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } Pracovnik: { onDelete: CASCADE, local: pracovnik_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } Agentura: { onDelete: CASCADE, local: agentura_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } Hodina: { onDelete: CASCADE, class: Kurz_hodina, local: hodina_id, foreign: id, foreignAlias: Documents, type: one, foreignType: many } DocumentEvent: actAs: Timestampable: updated: disabled: true columns: document_id: { type: integer, notnull: true } zakaznik_id: { type: integer, notnull: true } personalista_id: { type: integer, notnull: false } agentura_id: { type: integer, notnull: false } user_name: { type: string(255), notnull: true } document_name: { type: string(255), notnull: true } document_path: { type: string(255), notnull: false } action: { type: string(255), values: [create, update, delete], notnull: true } relations: Zakaznik: { onDelete: CASCADE, local: zakaznik_id, foreign: id, foreignAlias: DocumentEvents, type: one, foreignType: many } Agentura: { onDelete: NO ACTION, local: agentura_id, foreign: id, foreignAlias: DocumentEvents, type: one, foreignType: many } Personalista: { onDelete: NO ACTION, local: personalista_id, foreign: id, foreignAlias: DocumentEvents, type: one, foreignType: many } Plan: actAs: Timestampable: ~ columns: zakaznik_id: { type: integer, notnull: true } name: { type: string(255), notnull: true } type: { type: enum, values: [static, periodic], default: static } period: { type: integer, notnull: false } relations: Zakaznik: { onDelete: CASCADE, local: zakaznik_id, foreign: id, foreignAlias: Plans, type: one, foreignType: many } PlanLevel: actAs: Timestampable: ~ columns: plan_id: { type: integer, notnull: true } position: { type: integer, notnull: true, default: 1 } name: { type: string(255), notnull: true } relations: Plan: { onDelete: CASCADE, local: plan_id, foreign: id, foreignAlias: Levels, type: one, foreignType: many } PlanPracovnik: actAs: Timestampable: ~ columns: pracovnik_id: { type: integer, notnull: true } plan_id: { type: integer, notnull: true } level_id: { type: integer, notnull: false } is_met: { type: boolean, notnull: false, default: false } met_date: { type: timestamp, notnull: true } validity: { type: timestamp, notnull: false } relations: Pracovnik: { onDelete: CASCADE, local: pracovnik_id, foreign: id, foreignAlias: PlanRelations, type: one, foreignType: many } Plan: { onDelete: CASCADE, local: plan_id, foreign: id, foreignAlias: PracovnikRelations, type: one, foreignType: many } Level: { class: PlanLevel, onDelete: CASCADE, local: level_id, foreign: id, foreignAlias: PlanPracovnikRelations, type: one, foreignType: many } PlanKurz: actAs: Timestampable: ~ columns: kurz_id: { type: integer, notnull: true } plan_id: { type: integer, notnull: true } level_id: { type: integer, notnull: false } met_attend: { type: integer, notnull: true, default: 100 } relations: Kurz: { onDelete: CASCADE, local: kurz_id, foreign: id, foreignAlias: PlanRelations, type: one, foreignType: many } Plan: { onDelete: CASCADE, local: plan_id, foreign: id, foreignAlias: KurzRelations, type: one, foreignType: many } Level: { class: PlanLevel, onDelete: CASCADE, local: level_id, foreign: id, foreignAlias: PlanKurzRelations, type: one, foreignType: many }