Editing WikiDB/Defining tables
From TestWiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
== Basic principles == | == Basic principles == | ||
− | === Tables === | + | === Tables ==== |
− | * | + | * You need to define one ore more 'table' namespaces, in <code>LocalSettings.php</code>. |
* Any page in a table namespace is a table definition, which is referred to by its page name (e.g. <code><nowiki>[[Table:People]]</nowiki></code>). | * Any page in a table namespace is a table definition, which is referred to by its page name (e.g. <code><nowiki>[[Table:People]]</nowiki></code>). | ||
* The content of each page in a table namespace defines the schema for a specific table. | * The content of each page in a table namespace defines the schema for a specific table. | ||
− | * When referring to tables, the namespace prefix is only required | + | * When referring to tables, the namespace prefix is only required if there are multiple table namespaces (and even then, only in some situations). |
* Creating redirects within a table namespace allows you to set up alternative names for tables. The most common use for this is to allow you to rename/move a table without having to update all existing data definitions to use the new name. | * Creating redirects within a table namespace allows you to set up alternative names for tables. The most common use for this is to allow you to rename/move a table without having to update all existing data definitions to use the new name. | ||
− | === Data in tables === | + | === Data in tables ==== |
* Data exists independently of any table structure, which has a number of important implications: | * Data exists independently of any table structure, which has a number of important implications: |