Admin:db

From The Scuba Wiki

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
Here is the DB structure:
Here is the DB structure:
-
<nowiki>
+
<div style="font-family:courier;">
-
mysql> describe categorylinks;
+
mysql> describe categorylinks;<br>
-
+--------------+------------------+------+-----+-------------------+-------+
+
+--------------+------------------+------+-----+-------------------+-------+<br>
-
| Field        | Type            | Null | Key | Default          | Extra |
+
| Field        | Type            | Null | Key | Default          | Extra |<br>
-
+--------------+------------------+------+-----+-------------------+-------+
+
+--------------+------------------+------+-----+-------------------+-------+<br>
-
| cl_from      | int(10) unsigned | NO  | PRI | 0                |      |  
+
| cl_from      | int(10) unsigned | NO  | PRI | 0                |      |<br>
-
| cl_to        | varbinary(255)  | NO  | PRI | NULL              |      |  
+
| cl_to        | varbinary(255)  | NO  | PRI | NULL              |      |<br>
-
| cl_sortkey  | varbinary(70)    | NO  |    | NULL              |      |  
+
| cl_sortkey  | varbinary(70)    | NO  |    | NULL              |      |<br>
-
| cl_timestamp | timestamp        | YES  |    | CURRENT_TIMESTAMP |      |  
+
| cl_timestamp | timestamp        | YES  |    | CURRENT_TIMESTAMP |      |<br>
-
+--------------+------------------+------+-----+-------------------+-------+
+
+--------------+------------------+------+-----+-------------------+-------+<br>
Text fields are stored here:
Text fields are stored here:
-
mysql> describe smw_text2;
+
mysql> describe smw_text2;<br>
-
+------------+-----------------+------+-----+---------+-------+
+
+------------+-----------------+------+-----+---------+-------+<br>
-
| Field      | Type            | Null | Key | Default | Extra |
+
| Field      | Type            | Null | Key | Default | Extra |<br>
-
+------------+-----------------+------+-----+---------+-------+
+
+------------+-----------------+------+-----+---------+-------+<br>
-
| s_id      | int(8) unsigned | NO  | MUL | NULL    |      |  
+
| s_id      | int(8) unsigned | NO  | MUL | NULL    |      |<br>
-
| p_id      | int(8) unsigned | NO  | MUL | NULL    |      |  
+
| p_id      | int(8) unsigned | NO  | MUL | NULL    |      |<br>
-
| value_blob | mediumblob      | YES  |    | NULL    |      |  
+
| value_blob | mediumblob      | YES  |    | NULL    |      |<br>
-
+------------+-----------------+------+-----+---------+-------+
+
+------------+-----------------+------+-----+---------+-------+<br>
3 rows in set (0.00 sec)
3 rows in set (0.00 sec)
-
</nowiki>
+
</div>

Revision as of 17:03, 9 February 2010

DB Stuff

Note, edit this page to actually be able to see anything. It's gibberish in wiki format.

Categories can easily be searched in the categorylinks table

select * FROM categorylinks WHERE cl_to = 'Test'

Here is the DB structure:

mysql> describe categorylinks;
+--------------+------------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+-------------------+-------+
| cl_from | int(10) unsigned | NO | PRI | 0 | |
| cl_to | varbinary(255) | NO | PRI | NULL | |
| cl_sortkey | varbinary(70) | NO | | NULL | |
| cl_timestamp | timestamp | YES | | CURRENT_TIMESTAMP | |
+--------------+------------------+------+-----+-------------------+-------+

Text fields are stored here:

mysql> describe smw_text2;
+------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-----------------+------+-----+---------+-------+
| s_id | int(8) unsigned | NO | MUL | NULL | |
| p_id | int(8) unsigned | NO | MUL | NULL | |
| value_blob | mediumblob | YES | | NULL | |
+------------+-----------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

support the site