BASEDIR "./src/"; LIBARYX mproject PREFIX MP { VERSION "0.0.1"; GENTABLEXML ; ENUM TicketType(common,support,developer); MODEL Project { id ObjectID; parent NULLABLE REF Project:id DROP=CASCADE ALTER=CASCADE; name String(128) DEFAULT ''; status Short DEFAULT '10'; enabled Short DEFAULT '1'; view_state Short DEFAULT '10'; access_min Short DEFAULT '10'; file_path String(250) DEFAULT ''; description Text ; category_id Integer DEFAULT '1'; inherit_global Integer DEFAULT '0'; PKEY id; UNIQUE idx_project_name name; INDEX idx_project_view view_state; } MODEL ProjectModule { id ObjectID; parent REF Project:id; title String(128); PKEY id; } MODEL ProjectModuleRepository EXTENDS ProjectModule { info Text; type String(32); repoBase String(255); PKEY _id; } MODEL ProjectModuleDownload EXTENDS ProjectModule { info Text; PKEY _id; } MODEL ProjectModuleTicket EXTENDS ProjectModule { type ENUM TicketType; info Text; PKEY _id; } MODEL Ticket { id ObjectID; module REF ProjectModule:id; created_at DateTime DEFAULT NOW; created_by_id NULLABLE UserID; created_by_name NULLABLE String(128); category Integer; dublicate_of NULLABLE REF Ticket:id; severity Short DEFAULT 0; priority Short DEFAULT 0; reproducibility Short DEFAULT 0; status Short DEFAULT 0; resolution Short DEFAULT 0; projection Short DEFAULT 0; eta Short DEFAULT 0; description Text; summary Text; // handler_id Integer DEFAULT '0', // view_state Short DEFAULT '10', // summary String(128) DEFAULT '', // sponsorship_total Integer DEFAULT '0', // sticky Short DEFAULT '0', // date_submitted Integer DEFAULT '1', // due_date Integer DEFAULT '1', // last_updated Integer DEFAULT '1', PKEY id; } MODEL TicketDeveloper EXTENDS Ticket { os String(64); // os_build String(128); // platform String(32) DEFAULT '', version String(64); // fixed_in_version String(64) DEFAULT '', build String(64); // profile_id Integer DEFAULT '0', target_version NULLABLE String(64); PKEY _id; } MODEL TicketLog { id ObjectID; modified_by UserID; modified_at DateTime DEFAULT NOW; type String(32); note NULLABLE String(255); PKEY id; } } MODULEX mproject.Projects EXTENDS base { VERSION "0.0.1"; GENTABLEXML REPLACE; view index { } } MODULEX mproject.Tickets EXTENDS base { VERSION "0.0.1"; GENTABLEXML REPLACE; MODEL Category { id ObjectID; project_id NULLABLE REF #mproject.Project:id DROP=CASCADE ALTER=CASCADE; user_id UserID; name String(128) DEFAULT ''; status Integer DEFAULT '0'; PKEY id; UNIQUE idx_category_project_name project_id,name; } MODEL Bug { id ObjectID; project_id NULLABLE REF #mproject.Project:id DROP=CASCADE ALTER=CASCADE; reporter_id Integer DEFAULT '0'; handler_id Integer DEFAULT '0'; duplicate_id Integer DEFAULT '0'; priority Short DEFAULT '30'; severity Short DEFAULT '50'; reproducibility Short DEFAULT '10'; status Short DEFAULT '10'; resolution Short DEFAULT '10'; projection Short DEFAULT '10'; eta Short DEFAULT '10'; os String(32) DEFAULT ''; os_build String(32) DEFAULT ''; platform String(32) DEFAULT ''; version String(64) DEFAULT ''; fixed_in_version String(64) DEFAULT ''; build String(32) DEFAULT ''; profile_id Integer DEFAULT '0'; view_state Short DEFAULT '10'; summary String(128) DEFAULT ''; sponsorship_total Integer DEFAULT '0'; sticky Short DEFAULT '0'; target_version String(64) DEFAULT ''; category_id Integer DEFAULT '1'; date_submitted Integer DEFAULT '1'; due_date Integer DEFAULT '1'; last_updated Integer DEFAULT '1'; description Text ; steps_to_reproduce Text ; additional_information Text ; PKEY id; INDEX idx_bug_sponsorship_total sponsorship_total; INDEX idx_bug_fixed_in_version fixed_in_version; INDEX idx_bug_status status; INDEX idx_project project_id; } MODEL BugNote { id ObjectID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; reporter_id NULLABLE UserID; bugnote_text_id Integer DEFAULT '0'; view_state Short DEFAULT '10'; note_type Integer DEFAULT '0'; note_attr String(250) DEFAULT ''; time_tracking Integer DEFAULT '0'; last_modified Integer DEFAULT '1'; date_submitted Integer DEFAULT '1'; note Text; PKEY id; INDEX idx_bug bug_id; INDEX idx_last_mod last_modified; } MODEL BugFile { id ObjectID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; title String(250) DEFAULT ''; description String(250) DEFAULT ''; diskfile String(250) DEFAULT ''; filename String(250) DEFAULT ''; folder String(250) DEFAULT ''; filesize Integer DEFAULT '0'; file_type String(250) DEFAULT ''; content Blob ; date_added Integer DEFAULT '1'; user_id UserID; PKEY id; INDEX idx_bug_file_bug_id bug_id; INDEX idx_diskfile diskfile; } MODEL BugHistory { id ObjectID; user_id UserID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; field_name String(64) ; old_value String(255) ; new_value String(255) ; type Short DEFAULT '0'; date_modified Integer DEFAULT '1'; PKEY id; INDEX idx_bug_history_bug_id bug_id; INDEX idx_history_user_id user_id; } MODEL BugMonitor { user_id UserID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; PKEY user_id,bug_id; } MODEL BugRelationship { id ObjectID; source_bug_id Integer DEFAULT '0'; destination_bug_id Integer DEFAULT '0'; relationship_type Short DEFAULT '0'; PKEY id; INDEX idx_relationship_source source_bug_id; INDEX idx_relationship_destination destination_bug_id; } MODEL BugRevision { id ObjectID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; bugnote_id Integer DEFAULT '0'; user_id Integer ; type Integer ; value Text; timestamp Integer DEFAULT '1'; PKEY id; INDEX idx_bug_rev_type type; INDEX idx_bug_rev_id_time bug_id,timestamp; } MODEL BugTag { bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; tag_id Integer DEFAULT '0'; user_id UserID; date_attached Integer DEFAULT '1'; PKEY bug_id,tag_id; INDEX idx_bug_tag_tag_id tag_id; } MODEL Config { config_id String(64) ; project_id Integer DEFAULT '0'; user_id UserID; access_reqd Integer DEFAULT '0'; type Integer DEFAULT '90'; value Text ; PKEY config_id,project_id,user_id; } MODEL CustomFieldProject { field_id Integer DEFAULT '0'; project_id Integer DEFAULT '0'; sequence Short DEFAULT '0'; PKEY field_id,project_id; } MODEL CustomFieldString { field_id Integer DEFAULT '0'; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; value String(255) DEFAULT ''; PKEY field_id,bug_id; INDEX idx_custom_field_bug bug_id; } MODEL CustomField { id ObjectID; name String(64) DEFAULT ''; type Short DEFAULT '0'; possible_values Text ; default_value String(255) DEFAULT ''; valid_regexp String(255) DEFAULT ''; access_level_r Short DEFAULT '0'; access_level_rw Short DEFAULT '0'; length_min Integer DEFAULT '0'; length_max Integer DEFAULT '0'; require_report Short DEFAULT '0'; require_update Short DEFAULT '0'; display_report Short DEFAULT '0'; display_update Short DEFAULT '1'; require_resolved Short DEFAULT '0'; display_resolved Short DEFAULT '0'; display_closed Short DEFAULT '0'; require_closed Short DEFAULT '0'; filter_by Short DEFAULT '1'; PKEY id; INDEX idx_custom_field_name name; } MODEL Email { email_id ObjectID; email String(64) DEFAULT ''; subject String(250) DEFAULT ''; metadata Text ; body Text ; submitted Integer DEFAULT '1'; PKEY email_id; } MODEL Filter { id ObjectID; user_id UserID; project_id Integer DEFAULT '0'; is_public Short DEFAULT NULL; name String(64) DEFAULT ''; filter_string Text ; PKEY id; } MODEL Plugin { basename String(40) ; enabled Short DEFAULT '0'; protected Short DEFAULT '0'; priority Integer DEFAULT '3'; PKEY basename; } MODEL ProjectFile { id ObjectID; project_id Integer DEFAULT '0'; title String(250) DEFAULT ''; description String(250) DEFAULT ''; diskfile String(250) DEFAULT ''; filename String(250) DEFAULT ''; folder String(250) DEFAULT ''; filesize Integer DEFAULT '0'; file_type String(250) DEFAULT ''; content Blob ; date_added Integer DEFAULT '1'; user_id UserID; PKEY id; } MODEL ProjectHierarchy { child_id Integer ; parent_id Integer ; inherit_parent Integer DEFAULT '0'; INDEX idx_project_hierarchy_child_id child_id; INDEX idx_project_hierarchy_parent_id parent_id; } MODEL ProjectUserList { project_id Integer DEFAULT '0'; user_id UserID; access_level Short DEFAULT '10'; PKEY project_id,user_id; INDEX idx_project_user user_id; } MODEL ProjectVersion { id ObjectID; project_id Integer DEFAULT '0'; version String(64) DEFAULT ''; description Text ; released Short DEFAULT '1'; obsolete Short DEFAULT '0'; date_order Integer DEFAULT '1'; PKEY id; UNIQUE idx_project_version project_id,version; } MODEL Sponsorship { id ObjectID; bug_id REF Bug:id DROP=CASCADE ALTER=CASCADE; user_id UserID; amount Integer DEFAULT '0'; logo String(128) DEFAULT ''; url String(128) DEFAULT ''; paid Short DEFAULT '0'; date_submitted Integer DEFAULT '1'; last_updated Integer DEFAULT '1'; PKEY id; INDEX idx_sponsorship_bug_id bug_id; INDEX idx_sponsorship_user_id user_id; } MODEL Tag { id ObjectID; user_id UserID; name String(100) DEFAULT ''; description Text ; date_created Integer DEFAULT '1'; date_updated Integer DEFAULT '1'; PKEY id,name; INDEX idx_tag_name name; } MODEL Tokens { id ObjectID; owner Integer ; type Integer ; value Text ; timestamp Integer DEFAULT '1'; expiry Integer DEFAULT '1'; PKEY id; INDEX idx_typeowner type,owner; } MODEL UserPref { id ObjectID; user_id UserID; project_id Integer DEFAULT '0'; default_profile Integer DEFAULT '0'; default_project Integer DEFAULT '0'; refresh_delay Integer DEFAULT '0'; redirect_delay Integer DEFAULT '0'; bugnote_order String(4) DEFAULT 'ASC'; email_on_new Short DEFAULT '0'; email_on_assigned Short DEFAULT '0'; email_on_feedback Short DEFAULT '0'; email_on_resolved Short DEFAULT '0'; email_on_closed Short DEFAULT '0'; email_on_reopened Short DEFAULT '0'; email_on_bugnote Short DEFAULT '0'; email_on_status Short DEFAULT '0'; email_on_priority Short DEFAULT '0'; email_on_priority_min_severity Short DEFAULT '10'; email_on_status_min_severity Short DEFAULT '10'; email_on_bugnote_min_severity Short DEFAULT '10'; email_on_reopened_min_severity Short DEFAULT '10'; email_on_closed_min_severity Short DEFAULT '10'; email_on_resolved_min_severity Short DEFAULT '10'; email_on_feedback_min_severity Short DEFAULT '10'; email_on_assigned_min_severity Short DEFAULT '10'; email_on_new_min_severity Short DEFAULT '10'; email_bugnote_limit Short DEFAULT '0'; language String(32) DEFAULT 'english'; timezone String(32) DEFAULT ''; PKEY id; } MODEL UserPrintPref { user_id UserID; print_pref String(64) ; PKEY user_id; } MODEL UserProfile { id ObjectID; user_id UserID; platform String(32) DEFAULT ''; os String(32) DEFAULT ''; os_build String(32) DEFAULT ''; description Text ; PKEY id; } view index { } } MODULEX mproject.Wiki EXTENDS base { VERSION "0.0.1"; view index { } }