ToDo

  • clean oldstate in glpi_software
  • clean all DB : see CleanDbStudy

Naming Conventions

  • Database tables : plural ex : glpi_contracts glpi_computertypes
  • many to many join table : alphabetically_first_table_plural_alphabetically_second_table_plural ex : glpi_contracts_enterprises
  • field names :
    • standard names : id, name,date_in, begin_date...
    • lowercase for all (ID -> id...)
    • in singular
  • foreign keys
    • tablelinkedinplural_id : users_id profiles_users_id
    • case of multiple keys to a table :
      • users_id_author users_id_recipient
  • Index names :
    • simple index : field name / complex index : specific name
  • boolean fields use tinyint(1) and have a name beginning by 'is_' or 'use_' or something making the boolean idea obvious
  • How to manage device_type fk_device ?
    • find new names for items : item_type (int(11)) / items_id (int(11))
    • find new names for device (components) : devicetype (int(11)) / devices_id (int(11))
    • find new names for auth methods : authtype (int(11)) / auths_id (int(11))
  • datatype used : mysql -> standard datatype
    • varchar(255) -> string
    • char(xx) -> string
    • int(11) -> integer
    • text -> text
    • datetime -> datetime
    • tinyint(1) -> boolean (try to have fields named is_xxx or use_yyy)
    • date -> date
    • datetime -> datetime
    • time -> time
    • float -> float
    • decimal(20,4) -> price, amount
  • add datemod field for all table ?

Indexes which can de deleted

  • Les indexes simples montrent quand même un gain en terme d'accès sur des requêtes simples :
    SELECT *
    FROM glpi_computers
    WHERE is_template = '1'
    -> OK ON GARDE
  • glpi_dropdown_kbcategories : parentID (Cf parentID_2) -> intérêt de parentID_2 ?

Done

  • glpi_alerts : item (inclu dans alert) / device_type
  • glpi_cartridges_assoc : FK_glpi_type_printer_2 (Cf FK_glpi_type_printer)
  • glpi_computer_device : device_type (Cf device_type_2)
  • glpi_connect_wire : end1 (Cf end1_1)
  • glpi_contact_enterprise : FK_enterprise_2 (Cf FK_enterprise)
  • glpi_contract_device : FK_contract_2 (Cf FK_contract)
  • glpi_contract_enterprise : FK_enterprise_2 (Cf FK_enterprise)
  • glpi_display : type (Cf type_2)
  • glpi_doc_device : FK_doc_2 (Cf FK_doc)
  • glpi_links_device : device_type (Cf device_type_2)
  • glpi_mailing : type (Cf mailings) / item_type (Cf items)
  • glpi_networking_ports : on_device_2 (Cf on_device)
  • glpi_networking_vlan : FK_port (Cf FK_port_2)
  • glpi_networking_wire : end1 (Cf end1_1)
  • glpi_printers : id
  • glpi_reservation_item : device_type (Cf device_type_2)
  • glpi_users : name_2 (Cf name)
  • glpi_users_groups : FK_users_2 (Cf FK_users)
Missing indexes :
  • glpi_softwarelicenses.name .type
  • glpi_softwareversions.name

Commentaires des champs de la base

  • Rajouter des commentaires pour chaque champs ajouté en base