summaryrefslogtreecommitdiffstats
path: root/schema.xml
diff options
context:
space:
mode:
Diffstat (limited to 'schema.xml')
-rw-r--r--schema.xml46
1 files changed, 46 insertions, 0 deletions
diff --git a/schema.xml b/schema.xml
new file mode 100644
index 0000000..84b458e
--- /dev/null
+++ b/schema.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<database name="default" defaultIdMethod="native" defaultPhpNamingMethod="underscore">
+ <table name="category" idMethod="native" phpName="Category">
+ <column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
+ <column name="name" phpName="Name" type="VARCHAR" size="100" required="true"/>
+ <column name="description" phpName="Description" type="VARCHAR" size="1000"/>
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ </vendor>
+ </table>
+ <table name="product" idMethod="native" phpName="Product">
+ <column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
+ <column name="name" phpName="Name" type="VARCHAR" size="100" required="true"/>
+ <column name="price" phpName="Price" type="DECIMAL" size="10" scale="2" required="true"/>
+ <column name="width" phpName="Width" type="INTEGER" required="true"/>
+ <column name="height" phpName="Height" type="INTEGER" required="true"/>
+ <column name="description" phpName="Description" type="VARCHAR" size="1000"/>
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ </vendor>
+ </table>
+ <table name="product_category" idMethod="native" phpName="ProductCategory" isCrossRef="true">
+ <column name="product_id" phpName="ProductId" type="INTEGER" primaryKey="true" required="true"/>
+ <column name="category_id" phpName="CategoryId" type="INTEGER" primaryKey="true" required="true"/>
+ <foreign-key foreignTable="category" name="product_category_ibfk_1">
+ <reference local="category_id" foreign="id"/>
+ </foreign-key>
+ <foreign-key foreignTable="product" name="product_category_ibfk_2">
+ <reference local="product_id" foreign="id"/>
+ </foreign-key>
+ <index name="category_id">
+ <index-column name="category_id"/>
+ </index>
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ </vendor>
+ </table>
+ <table name="user" idMethod="native" phpName="User">
+ <column name="username" phpName="Username" type="VARCHAR" size="100" primaryKey="true" required="true"/>
+ <column name="password" phpName="Password" type="CHAR" size="40" required="true"/>
+ <column name="salt" phpName="Salt" type="CHAR" size="20" required="true"/>
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ </vendor>
+ </table>
+</database>