Requests for comment/Associated namespaces/Database schemas

Preliminary notes edit

See: User:Skizzerz/Namespaces#Preliminary_notes

Planning edit

New database schemas edit

  • New namespace table needed to hold namespace relational data, based on previous work by Skizzerz.
  • Cannot guarantee that a talk namespace number will directly follow the namespace it is tied to, so this change needs to be reflected in code.
Schema for namespace table
Field Type Extra Notes
ns_id int NOT NULL PRIMARY KEY
  • Namespace id, tied to NS_* constant.
  • Cannot autoincrement due to negative namespace numbers
ns_canonical_name varchar(32) NOT NULL
  • Canonical namespace name
ns_local_name varchar(64) NOT NULL
  • Localized namespace name
    • The (primary) name in the content language
ns_settings json/blob NOT NULL DEFAULT ""
  • Index nl_namespace_name on nl_namespace and nl_name
  • Unique index nl_namespace_default on nl_namespace and nl_default
namespace_relations
Field Type
nsr_id int
nsr_from_id int (corresponds to ns_id)
nsr_target_id int (corresponds to ns_id)
nsr_type varchar(32)
  • Type of namespace from a predefined list.
  • Possible options: talk, documentation, schema, data-item, dataproperty...

Example edit

id from_id target_id type
0 11 10 talk
1 16 10 documentation
2 17 10 schema
3 11 16 talk
4 11 17 talk

See also edit