Structure de la base de données : Différence entre versions
(→Champs cachés) |
(→Structure) |
||
(19 révisions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
+ | =[[Media:OpenFlyers_database_schema.png|Schéma de la structure de la base de données]]= | ||
+ | |||
=Structure= | =Structure= | ||
Ligne 24 : | Ligne 26 : | ||
on account (owner_id); | on account (owner_id); | ||
− | + | CREATE TABLE `account_entry` ( | |
− | ( | + | `id` int(11) NOT NULL AUTO_INCREMENT, |
− | + | `flow_id` int(11) DEFAULT NULL, | |
− | + | `account_date` datetime DEFAULT NULL, | |
− | + | `account_id` int(11) DEFAULT NULL, | |
− | + | `credit` decimal(15,5) DEFAULT '0.00000', | |
− | + | `debit` decimal(15,5) DEFAULT '0.00000', | |
− | + | `payment_type` int(10) unsigned DEFAULT NULL, | |
− | + | `payment_description` text, | |
− | + | `person_delivery_id` int(10) unsigned DEFAULT NULL, | |
− | + | `comments` text, | |
− | + | `validated` int(1) DEFAULT '0', | |
− | + | `exported` int(1) DEFAULT '0', | |
− | + | `registration_date` datetime DEFAULT NULL, | |
− | + | `budget_id` int(10) unsigned DEFAULT NULL, | |
− | + | `product_id` int(10) unsigned DEFAULT NULL, | |
− | + | `signature` varchar(56) DEFAULT NULL, | |
− | + | `signature_date` bigint(13) unsigned DEFAULT NULL, | |
− | + | `lettering` int(11) DEFAULT NULL, | |
− | + | `lettering_date` datetime DEFAULT NULL, | |
− | + | `flow_reversal_id` int(10) unsigned DEFAULT NULL, | |
− | + | `transaction_id` text, | |
− | ) | + | PRIMARY KEY (`id`), |
− | + | KEY `idx_flow_id` (`flow_id`), | |
− | + | KEY `idx_account_date` (`account_date`), | |
− | + | KEY `idx_signature_date` (`signature_date`), | |
− | + | KEY `flow_reversal_id_idx` (`flow_reversal_id`) | |
− | + | ); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
create table account_link | create table account_link | ||
Ligne 101 : | Ligne 98 : | ||
profile_id bigint unsigned default 0 not null, | profile_id bigint unsigned default 0 not null, | ||
primary key (accounting_id, profile_id) | primary key (accounting_id, profile_id) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
); | ); | ||
Ligne 267 : | Ligne 250 : | ||
resource_id int unsigned default 0 not null, | resource_id int unsigned default 0 not null, | ||
primary key (booking_id, resource_id) | primary key (booking_id, resource_id) | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `booking_training_program` ( | ||
+ | `booking_group_id` int(10) unsigned NOT NULL, | ||
+ | `training_program_id` int(10) unsigned NOT NULL, | ||
+ | PRIMARY KEY (`booking_group_id`,`training_program_id`), | ||
+ | CONSTRAINT `booking_training_program_training_program_id_fk` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`) | ||
); | ); | ||
Ligne 287 : | Ligne 277 : | ||
); | ); | ||
− | + | CREATE TABLE `business_field` ( | |
− | ( | + | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
− | + | `variable` varchar(255) DEFAULT NULL, | |
− | + | `label` varchar(255) NOT NULL, | |
− | + | `value_type` varchar(40) NOT NULL, | |
− | + | `category` varchar(255) NOT NULL, | |
− | + | `order_num` int(11) NOT NULL, | |
− | + | `dsn` varchar(20) DEFAULT 'customer', | |
− | + | `compulsory_fill` tinyint(1) DEFAULT '0', | |
− | + | `linked_category` varchar(255) DEFAULT NULL, | |
− | + | `linked_business_field_id` int(10) unsigned DEFAULT NULL, | |
− | + | `linked_field_name` varchar(255) DEFAULT NULL, | |
− | + | `max_display` int(10) DEFAULT '-1', | |
− | + | `formula` text, | |
− | + | `default_value` text, | |
− | + | `placeholder` text, | |
− | + | `access_level_required` tinyint(4) NOT NULL DEFAULT '0', | |
− | + | `user_access_mode` tinyint(1) NOT NULL DEFAULT '0', | |
− | + | PRIMARY KEY (`id`), | |
− | + | UNIQUE KEY `variable` (`variable`), | |
− | + | KEY `business_field_linked_business_field_id_fk` (`linked_business_field_id`), | |
− | ) | + | CONSTRAINT `business_field_linked_business_field_id_fk` FOREIGN KEY (`linked_business_field_id`) REFERENCES `business_field` (`id`) |
− | + | ) COMMENT='List of extra form field'; | |
create table business_field_activity_type | create table business_field_activity_type | ||
Ligne 648 : | Ligne 638 : | ||
); | ); | ||
− | + | CREATE TABLE `flight_track` ( | |
− | ( | + | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
− | + | `flight_id` int(10) NOT NULL, | |
− | + | `track` mediumblob NOT NULL, | |
− | + | `file_type` varchar(255) DEFAULT 'kml', | |
− | + | PRIMARY KEY (`id`) | |
); | ); | ||
Ligne 1 006 : | Ligne 996 : | ||
primary key (code, key_id) | primary key (code, key_id) | ||
); | ); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
create table payment_summary_file | create table payment_summary_file | ||
Ligne 1 030 : | Ligne 1 009 : | ||
); | ); | ||
− | + | CREATE TABLE `payment_type` ( | |
− | ( | + | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
− | + | `name` text, | |
− | + | `text_field_label` text, | |
− | + | `only_admin` tinyint(1) unsigned NOT NULL DEFAULT '0', | |
− | + | `pos_key_id` int(10) unsigned DEFAULT NULL, | |
− | + | `treasury_account_id` int(10) unsigned DEFAULT NULL, | |
− | + | `person_delivery` tinyint(1) unsigned DEFAULT '0', | |
− | + | `person_budget_id` int(10) unsigned DEFAULT NULL, | |
− | ) | + | `treasury_budget_id` int(10) unsigned DEFAULT NULL, |
− | + | `minimum_amount` decimal(10,0) DEFAULT NULL, | |
+ | `maximum_amount` decimal(10,0) DEFAULT NULL, | ||
+ | PRIMARY KEY (`id`) | ||
+ | ) COMMENT='type of payment description'; | ||
create table person | create table person | ||
Ligne 1 587 : | Ligne 1 569 : | ||
primary key, | primary key, | ||
name varchar(255) not null | name varchar(255) not null | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training` ( | ||
+ | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
+ | `name` varchar(255) NOT NULL, | ||
+ | PRIMARY KEY (`id`) | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_activity` ( | ||
+ | `activity_id` int(10) unsigned NOT NULL, | ||
+ | `training_item_id` int(10) unsigned NOT NULL DEFAULT '0', | ||
+ | `training_program_id` int(10) unsigned NOT NULL DEFAULT '1', | ||
+ | `level_reached` int(10) unsigned DEFAULT NULL, | ||
+ | `comment` varchar(255) DEFAULT NULL, | ||
+ | `validated` tinyint(1) NOT NULL DEFAULT '0', | ||
+ | PRIMARY KEY (`activity_id`,`training_item_id`,`training_program_id`), | ||
+ | KEY `training_program_id_idx` (`training_program_id`), | ||
+ | KEY `training_program_item_id_idx` (`training_program_id`,`training_item_id`), | ||
+ | CONSTRAINT `training_activity_training_program_id_fk` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
+ | CONSTRAINT `training_activity_training_program_item_id_fk` FOREIGN KEY (`training_program_id`, `training_item_id`) REFERENCES `training_program_item` (`training_program_id`, `training_item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_activity_next_item` ( | ||
+ | `student_id` int(10) unsigned NOT NULL, | ||
+ | `training_program_id` int(10) unsigned NOT NULL, | ||
+ | `training_item_id` int(10) unsigned NOT NULL, | ||
+ | `reporting_offset` tinyint(10) unsigned NOT NULL DEFAULT '0', | ||
+ | `item_preselected` tinyint(1) unsigned NOT NULL DEFAULT '0', | ||
+ | PRIMARY KEY (`student_id`,`training_program_id`,`training_item_id`), | ||
+ | KEY `training_item_id_idx` (`training_item_id`), | ||
+ | KEY `training_program_id_idx` (`training_program_id`), | ||
+ | KEY `training_activity_next_item_training_program_item_id_fk` (`training_program_id`,`training_item_id`), | ||
+ | CONSTRAINT `training_activity_next_item_student_id_fk` FOREIGN KEY (`student_id`) REFERENCES `person` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
+ | CONSTRAINT `training_activity_next_item_training_program_id_fk` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
+ | CONSTRAINT `training_activity_next_item_training_program_item_id_fk` FOREIGN KEY (`training_program_id`, `training_item_id`) REFERENCES `training_program_item` (`training_program_id`, `training_item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_activity_person` ( | ||
+ | `activity_id` int(10) unsigned NOT NULL, | ||
+ | `person_id` int(10) unsigned NOT NULL, | ||
+ | `num` int(10) unsigned NOT NULL DEFAULT '0', | ||
+ | `training_checking_date` datetime DEFAULT NULL, | ||
+ | `training_checking_sentence` varchar(255) DEFAULT NULL, | ||
+ | PRIMARY KEY (`activity_id`,`person_id`,`num`), | ||
+ | KEY `person_id_idx` (`person_id`), | ||
+ | CONSTRAINT `training_activity_person_activity_id_fk` FOREIGN KEY (`activity_id`) REFERENCES `flight` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
+ | CONSTRAINT `training_activity_person_person_id_fk` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_phase` ( | ||
+ | `training_program_item_order_num` int(11) unsigned NOT NULL, | ||
+ | `training_program_id` int(10) unsigned NOT NULL, | ||
+ | `name` varchar(255) DEFAULT NULL, | ||
+ | PRIMARY KEY (`training_program_item_order_num`,`training_program_id`), | ||
+ | KEY `training_program_id_idx` (`training_program_id`), | ||
+ | CONSTRAINT `training_phase_training_program_id_fk` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_program` ( | ||
+ | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
+ | `training_id` int(10) unsigned DEFAULT NULL, | ||
+ | `name` varchar(255) NOT NULL, | ||
+ | PRIMARY KEY (`id`), | ||
+ | KEY `training_id_idx` (`training_id`), | ||
+ | CONSTRAINT `training_program_training_id_fk` FOREIGN KEY (`training_id`) REFERENCES `training` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_program_activity` ( | ||
+ | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
+ | `training_program_id` int(10) unsigned NOT NULL, | ||
+ | `activity_type_id` bigint(20) unsigned NOT NULL, | ||
+ | `duration` int(11) unsigned DEFAULT NULL, | ||
+ | `breaktime` int(11) unsigned DEFAULT NULL, | ||
+ | `order_num` int(11) unsigned NOT NULL, | ||
+ | PRIMARY KEY (`id`), | ||
+ | KEY `training_program_id_idx` (`training_program_id`), | ||
+ | KEY `activity_type_id_idx` (`activity_type_id`), | ||
+ | CONSTRAINT `training_program_activity_activity_type_id_fk` FOREIGN KEY (`activity_type_id`) REFERENCES `activity_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
+ | CONSTRAINT `training_program_activity_training_program_id_fk` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE `training_item` ( | ||
+ | `training_id` int(10) unsigned NOT NULL, | ||
+ | `training_item_label_id` int(10) unsigned NOT NULL, | ||
+ | `number_of_sessions` int(11) NOT NULL, | ||
+ | `order_num` int(11) NOT NULL AUTO_INCREMENT, | ||
+ | PRIMARY KEY (`training_id`,`training_item_label_id`), | ||
+ | KEY `order_num_idx` (`order_num` ASC), | ||
+ | CONSTRAINT `training_item_training_id_fk` FOREIGN KEY (`training_id`) REFERENCES `training` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
); | ); | ||
Ligne 2 044 : | Ligne 2 115 : | ||
==Champs cachés== | ==Champs cachés== | ||
− | + | Les champs suivants ne peuvent être exportés et ne doivent pas être inclus dans une requête SELECT. De plus, un "SELECT *" est interdit quand une des tables contient un champ caché : | |
− | Les champs suivants ne peuvent être exportés et ne doivent pas être inclus dans une requête SELECT. De plus, un "SELECT *" | + | *Table journal : Tous les champs |
+ | *Table log : Tous les champs | ||
+ | *Table parameter : Tous les champs | ||
+ | *Table person : | ||
+ | **hash_password | ||
*Table structure : | *Table structure : | ||
− | ** | + | **address |
+ | **admin_num | ||
+ | **city | ||
+ | **country | ||
+ | **default_notification | ||
+ | **default_slot_range | ||
+ | **default_timezone | ||
+ | **default_view_type | ||
+ | **email | ||
+ | **fax | ||
+ | **first_hour_displayed | ||
**info_cell | **info_cell | ||
+ | **lang | ||
+ | **last_hour_displayed | ||
**logo | **logo | ||
**logo_name | **logo_name | ||
**logo_ext | **logo_ext | ||
**logo_size | **logo_size | ||
− | ** | + | **mail_from_address |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
**mailing_list_name | **mailing_list_name | ||
**mailing_list_type | **mailing_list_type | ||
− | ** | + | **min_slot_range |
− | ** | + | **name |
− | ** | + | **phone |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
**state | **state | ||
− | ** | + | **twilight_range |
− | ** | + | **usual_profiles |
− | + | ||
− | + | ||
− | + | ||
**welcome_cell | **welcome_cell | ||
− | + | **zipcode | |
− | *Table | + | *Table oauth_client : Tous les champs |
− | *Table | + | *Table oauth_access_token : Tous les champs |
− | *Table | + | *Table oauth_auth_code : Tous les champs |
− | + | *Table oauth_refresh_token : Tous les champs | |
− | *Table | + | |
− | + | ||
− | + | ||
Exemple de requêtes non autorisées : | Exemple de requêtes non autorisées : |
Version actuelle en date du 10 janvier 2024 à 16:25
Sommaire
Schéma de la structure de la base de données
Structure
create table account ( id int unsigned auto_increment primary key, creation_date date null, name text null, export_account varchar(255) null, activated tinyint(1) unsigned default 1 not null, category tinyint(1) unsigned default 0 null, account_type tinyint(1) unsigned default 0 null, owner_id int unsigned default 0 not null, payment_allowed tinyint(1) default 0 null, budget_id int unsigned null, order_num int null, accounting_id int unsigned null, deactivated_date datetime