<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.linuxmce.org/index.php?action=history&amp;feed=atom&amp;title=Sql2cpp_example</id>
	<title>Sql2cpp example - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.linuxmce.org/index.php?action=history&amp;feed=atom&amp;title=Sql2cpp_example"/>
	<link rel="alternate" type="text/html" href="http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;action=history"/>
	<updated>2026-07-21T20:21:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20003&amp;oldid=prev</id>
		<title>Tschak909: /* See Also */ whoops.</title>
		<link rel="alternate" type="text/html" href="http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20003&amp;oldid=prev"/>
		<updated>2009-07-23T08:47:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See Also: &lt;/span&gt; whoops.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:47, 23 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l134&quot;&gt;Line 134:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 134:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Code is here [[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Lmce_game_update&lt;/del&gt;]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Code is here [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Lmce_media_update&lt;/ins&gt;]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This code is used in GAMEROM.cpp/.h in src/UpdateMedia. Take a look to see the other side of the equation. Wiki link here: [[Gamerom]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This code is used in GAMEROM.cpp/.h in src/UpdateMedia. Take a look to see the other side of the equation. Wiki link here: [[Gamerom]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tschak909</name></author>
	</entry>
	<entry>
		<id>http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20002&amp;oldid=prev</id>
		<title>Tschak909: /* See Also */ Linkage.</title>
		<link rel="alternate" type="text/html" href="http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20002&amp;oldid=prev"/>
		<updated>2009-07-23T08:46:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See Also: &lt;/span&gt; Linkage.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:46, 23 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l133&quot;&gt;Line 133:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 133:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The Code is here [[Lmce_game_update]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This code is used in GAMEROM.cpp/.h in src/UpdateMedia. Take a look to see the other side of the equation. Wiki link here: [[Gamerom]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This code is used in GAMEROM.cpp/.h in src/UpdateMedia. Take a look to see the other side of the equation. Wiki link here: [[Gamerom]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tschak909</name></author>
	</entry>
	<entry>
		<id>http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20001&amp;oldid=prev</id>
		<title>Tschak909: Category addition.</title>
		<link rel="alternate" type="text/html" href="http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=20001&amp;oldid=prev"/>
		<updated>2009-07-23T08:45:34Z</updated>

		<summary type="html">&lt;p&gt;Category addition.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:45, 23 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l139&quot;&gt;Line 139:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 139:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-Thom&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-Thom&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Programmer&#039;s Guide]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tschak909</name></author>
	</entry>
	<entry>
		<id>http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=19994&amp;oldid=prev</id>
		<title>Tschak909: Initial Content.</title>
		<link rel="alternate" type="text/html" href="http://wiki.linuxmce.org/index.php?title=Sql2cpp_example&amp;diff=19994&amp;oldid=prev"/>
		<updated>2009-07-23T08:32:08Z</updated>

		<summary type="html">&lt;p&gt;Initial Content.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Rationale==&lt;br /&gt;
I needed to create a small utility to update the lmce_game metadata database when new versions of MAME were released.&lt;br /&gt;
&lt;br /&gt;
==Where To Get the code==&lt;br /&gt;
I have placed the code in src/lmce_media_update in the LinuxMCE-0810 source tree, and have it cut and paste into the wiki here:&lt;br /&gt;
[[Lmce_media_update]]&lt;br /&gt;
&lt;br /&gt;
The code to read this has been placed here:&lt;br /&gt;
[[Gamerom]]&lt;br /&gt;
&lt;br /&gt;
==Explanation of Table Schema==&lt;br /&gt;
Currently the lmce_game database stores simple attribute metadata for a series of ROMs using a schema pattern similar to pluto_media where the central tables are Rom, RomAttribute, and Rom_RomAttribute, creating essentially a Has and Belongs to many Pattern (HABTM)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; show tables;&lt;br /&gt;
+---------------------+&lt;br /&gt;
| Tables_in_lmce_game |&lt;br /&gt;
+---------------------+&lt;br /&gt;
| GameSystem          | &lt;br /&gt;
| Rom                 | &lt;br /&gt;
| RomAttribute        | &lt;br /&gt;
| RomAttributeType    | &lt;br /&gt;
| Rom_RomAttribute    | &lt;br /&gt;
| psc_game_batdet     | &lt;br /&gt;
| psc_game_bathdr     | &lt;br /&gt;
| psc_game_batuser    | &lt;br /&gt;
| psc_game_repset     | &lt;br /&gt;
| psc_game_schema     | &lt;br /&gt;
| psc_game_tables     | &lt;br /&gt;
+---------------------+&lt;br /&gt;
11 rows in set (0.00 sec)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Note about the psc tables===&lt;br /&gt;
The psc_ tables were created by sqlCVS when I told it to create a new repository in the database to hold history data. same for any psc_tables in the database, lmce_game_update is unaware of them, and does not touch them at all.&lt;br /&gt;
&lt;br /&gt;
===The Rom Table===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; explain Rom;&lt;br /&gt;
+---------------+--------------+------+-----+-------------------+----------------+&lt;br /&gt;
| Field         | Type         | Null | Key | Default           | Extra          |&lt;br /&gt;
+---------------+--------------+------+-----+-------------------+----------------+&lt;br /&gt;
| PK_Rom        | int(11)      | NO   | PRI | NULL              | auto_increment | &lt;br /&gt;
| FK_GameSystem | int(11)      | NO   | MUL | NULL              |                | &lt;br /&gt;
| Romname       | varchar(255) | YES  |     | NULL              |                | &lt;br /&gt;
| psc_id        | int(11)      | YES  |     | NULL              |                | &lt;br /&gt;
| psc_batch     | int(11)      | YES  |     | NULL              |                | &lt;br /&gt;
| psc_user      | int(11)      | YES  |     | NULL              |                | &lt;br /&gt;
| psc_frozen    | tinyint(1)   | YES  |     | 0                 |                | &lt;br /&gt;
| psc_mod       | timestamp    | NO   |     | CURRENT_TIMESTAMP |                | &lt;br /&gt;
| psc_restrict  | int(11)      | YES  |     | NULL              |                | &lt;br /&gt;
+---------------+--------------+------+-----+-------------------+----------------+&lt;br /&gt;
9 rows in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Rom table simply contains filenames, and maps them to PK_Rom entries.&lt;br /&gt;
&lt;br /&gt;
===The RomAttribute Table===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; explain RomAttribute;&lt;br /&gt;
+---------------------+------------+------+-----+-------------------+----------------+&lt;br /&gt;
| Field               | Type       | Null | Key | Default           | Extra          |&lt;br /&gt;
+---------------------+------------+------+-----+-------------------+----------------+&lt;br /&gt;
| PK_RomAttribute     | int(11)    | NO   | PRI | NULL              | auto_increment | &lt;br /&gt;
| FK_RomAttributeType | int(11)    | NO   | MUL | NULL              |                | &lt;br /&gt;
| FK_GameSystem       | int(11)    | NO   |     | NULL              |                | &lt;br /&gt;
| Name                | longtext   | YES  |     | NULL              |                | &lt;br /&gt;
| psc_id              | int(11)    | YES  |     | NULL              |                | &lt;br /&gt;
| psc_batch           | int(11)    | YES  |     | NULL              |                | &lt;br /&gt;
| psc_user            | int(11)    | YES  |     | NULL              |                | &lt;br /&gt;
| psc_frozen          | tinyint(1) | YES  |     | 0                 |                | &lt;br /&gt;
| psc_mod             | timestamp  | NO   |     | CURRENT_TIMESTAMP |                | &lt;br /&gt;
| psc_restrict        | int(11)    | YES  |     | NULL              |                | &lt;br /&gt;
+---------------------+------------+------+-----+-------------------+----------------+&lt;br /&gt;
10 rows in set (0.00 sec)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar for attributes, we simply store single attributes, and map them to PK_Attributes. &lt;br /&gt;
==== A Note about Foreign Keys and the related RomAttributeType table. ====&lt;br /&gt;
Notice FK_AttributeType? That&amp;#039;s a foreign key.&lt;br /&gt;
There is an AttributeType table which simply contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; select * from RomAttributeType;&lt;br /&gt;
+---------------------+--------------+--------------+-------------+---- ----+-----------+----------+------------+---------------------+--------------+&lt;br /&gt;
| PK_RomAttributeType | Define       | Description  | PicPriority | psc_id | psc_batch | psc_user | psc_frozen | psc_mod             | psc_restrict |&lt;br /&gt;
+---------------------+--------------+--------------+-------------+--------+-----------+----------+------------+---------------------+--------------+&lt;br /&gt;
|                   1 | title        | Title        |        NULL |      1 |      NULL |     NULL |          0 | 0000-00-00 00:00:00 |         NULL | &lt;br /&gt;
|                   2 | year         | Year         |        NULL |      2 |      NULL |     NULL |          0 | 0000-00-00 00:00:00 |         NULL | &lt;br /&gt;
|                   3 | manufacturer | Manufacturer |        NULL |      3 |      NULL |     NULL |          0 | 0000-00-00 00:00:00 |         NULL | &lt;br /&gt;
|                   4 | genre        | Genre        |        NULL |      4 |      NULL |     NULL |          0 | 0000-00-00 00:00:00 |         NULL | &lt;br /&gt;
+---------------------+--------------+--------------+-------------+--------+-----------+----------+------------+---------------------+--------------+&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table isn&amp;#039;t really used by lmce_update directly. Instead, when sql2cpp was run to generate the lmce_game class, there was a Define_RomAttributeType.h file, which contains among other things:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define ROMATTRIBUTETYPE_title_CONST 1&lt;br /&gt;
#define ROMATTRIBUTETYPE_year_CONST 2&lt;br /&gt;
#define ROMATTRIBUTETYPE_manufacturer_CONST 3&lt;br /&gt;
#define ROMATTRIBUTETYPE_genre_CONST 4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this is referenced in the code to provide a consistent way to put human readable constant names to the different attribute type integers.&lt;br /&gt;
&lt;br /&gt;
And finally to join the Roms and RomAttributes together, there is the Rom_RomAttribute Table, which really only has two real columns:&lt;br /&gt;
&lt;br /&gt;
===The Join Table: Rom_RomAttribute===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; explain Rom_RomAttribute;&lt;br /&gt;
+-----------------+------------+------+-----+-------------------+-------+&lt;br /&gt;
| Field           | Type       | Null | Key | Default           | Extra |&lt;br /&gt;
+-----------------+------------+------+-----+-------------------+-------+&lt;br /&gt;
| FK_Rom          | int(11)    | NO   | PRI | NULL              |       | &lt;br /&gt;
| FK_RomAttribute | int(11)    | NO   | PRI | NULL              |       | &lt;br /&gt;
| psc_id          | int(11)    | YES  |     | NULL              |       | &lt;br /&gt;
| psc_batch       | int(11)    | YES  |     | NULL              |       | &lt;br /&gt;
| psc_user        | int(11)    | YES  |     | NULL              |       | &lt;br /&gt;
| psc_frozen      | tinyint(1) | YES  |     | 0                 |       | &lt;br /&gt;
| psc_mod         | timestamp  | NO   |     | CURRENT_TIMESTAMP |       | &lt;br /&gt;
| psc_restrict    | int(11)    | YES  |     | NULL              |       | &lt;br /&gt;
+-----------------+------------+------+-----+-------------------+-------+&lt;br /&gt;
8 rows in set (0.00 sec)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Joining a Rom key, and a RomAttribute key.&lt;br /&gt;
&lt;br /&gt;
====sql2cpp Naming Conventions and their relationship to different keys====&lt;br /&gt;
&lt;br /&gt;
If you use these naming conventions, PK_ for primary key, FK_ for Foreign Key, and EK_ for External Key, sql2cpp will take these, and build C++ code to be able to link between them.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
This code is used in GAMEROM.cpp/.h in src/UpdateMedia. Take a look to see the other side of the equation. Wiki link here: [[Gamerom]]&lt;br /&gt;
&lt;br /&gt;
I hope this code shows some more of the tools used to build parts of this system.&lt;br /&gt;
&lt;br /&gt;
-Thom&lt;/div&gt;</summary>
		<author><name>Tschak909</name></author>
	</entry>
</feed>