change db schema to reflect new database model

master
Corne Oppelaar 9 years ago
parent 7b8fda4f10
commit 28a26883b3

@ -3,11 +3,11 @@
xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd"
namespace="Eater\Glim\Model"
>
<table name="User">
<table name="user">
<column name="id" type="integer" primaryKey="true" autoIncrement="true" />
<column name="max_keys" type="integer" default="5" />
<column name="username" type="varchar" size="64" />
<column name="email" size="256" />
<column name="email" type="integer" />
<column name="password" type="varchar" size="64" />
<column name="superuser" type="boolean" default="false" />
<column name="max_invites" type="integer" default="0" />
@ -16,9 +16,40 @@
<unique>
<unique-column name="username" />
</unique>
<foreign-key foreignTable="email_address">
<reference local="email" foreign="id" />
</foreign-key>
</table>
<table name="email_address">
<column name="id" type="integer" primaryKey="true" autoIncrement="true" />
<column name="verified" type="boolean" default="false" />
<column name="verification" type="varchar" size="64" />
<column name="address" type="varchar" size="256" />
<column name="owner" type="integer" />
<foreign-key foreignTable="user">
<reference local="owner" foreign="id" />
</foreign-key>
</table>
<table name="email_message">
<column name="recipient" type="integer" />
<column name="sender" type="integer" />
<column name="contents" type="longvarchar" />
<column name="subject" type="varchar" size="256" />
<foreign-key phpName="RecipientEmailAddress" foreignTable="email_address">
<reference local="recipient" foreign="id" />
</foreign-key>
<foreign-key phpName="SenderEmailAddress" foreignTable="email_address">
<reference local="sender" foreign="id" />
</foreign-key>
</table>
<table name="Certificate">
<table name="certificate">
<column name="id" type="integer" primaryKey="true" autoIncrement="true" />
<column name="user_id" type="integer" />
<column name="name" type="varchar" size="64" />
@ -41,22 +72,22 @@
<unique-column name="user_id" />
</unique>
<foreign-key foreignTable="User">
<foreign-key foreignTable="user">
<reference local="user_id" foreign="id" />
</foreign-key>
</table>
<table name="Invite">
<table name="invite">
<column name="id" type="integer" primaryKey="true" autoIncrement="true" />
<column name="invite" type="varchar" size="64" />
<column name="owner" type="integer" />
<foreign-key foreignTable="User">
<foreign-key foreignTable="user">
<reference local="owner" foreign="id" />
</foreign-key>
</table>
<table name="Server">
<table name="server">
<column name="id" type="integer" primaryKey="true" autoIncrement="true" />
<column name="fqdn" type="varchar" size="64" />
<column name="fingerprint" type="varchar" size="64"/>

Loading…
Cancel
Save