<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
	<name>*dbname*</name>
	<create>true</create>
	<overwrite>false</overwrite>
	<charset>utf8</charset>
	<table>
		<name>*dbprefix*office_session</name>
		<declaration>
			<field>
				<name>es_id</name>
				<type>text</type>
				<notnull>true</notnull>
				<length>64</length>
				<comments>Editing session id</comments>
			</field>
			<field>
				<name>genesis_url</name>
				<type>text</type>
				<default></default>
				<notnull>true</notnull>
				<length>512</length>
				<comments>Relative to owner office storage /welcome.odt</comments>
			</field>
			<field>
				<name>genesis_hash</name>
				<type>text</type>
				<notnull>true</notnull>
				<comments>To be sure the genesis did not change</comments>
			</field>
			<field>
				<name>document_path</name>
				<type>text</type>
				<default></default>
				<notnull>true</notnull>
				<length>512</length>
				<comments>Relative to storage e.g. /welcome.odt</comments>
			</field>			
			<field>
				<name>owner</name>
				<type>text</type>
				<notnull>true</notnull>
				<length>64</length>
				<comments>oC user who created the session</comments>
			</field>
			
			<index>
				<name>office_session_ei_index</name>
				<primary>true</primary>
				<unique>true</unique>
				<field>
					<name>es_id</name>
					<sorting>ascending</sorting>
				</field>
			</index>
		</declaration>
	</table>
	
	<table>
		<name>*dbprefix*office_op</name>
		<declaration>
			<field>
				<name>seq</name>
				<type>integer</type>
				<default>1</default>
				<notnull>true</notnull>
				<autoincrement>1</autoincrement>
				<unsigned>true</unsigned>
				<length>4</length>
				<comments>Sequence number</comments>
			</field>
			<field>
				<name>es_id</name>
				<type>text</type>
				<notnull>true</notnull>
				<length>64</length>
				<comments>Editing session id</comments>
			</field>
			<field>
				<name>member</name>
				<type>text</type>
				<length>128</length>
				<notnull>true</notnull>
				<comments>User and time specific</comments>
			</field>
			<field>
				<name>opspec</name>
				<type>clob</type>
				<notnull>false</notnull>
				<comments>json-string</comments>
			</field>
			<index>
				<name>seq_pKey</name>
				<primary>true</primary>
				<field>
					<name>seq</name>
					<sorting>ascending</sorting>
				</field>
			</index>
			<index>
				<name>office_op_eis_index</name>
				<unique>true</unique>
				<field>
					<name>es_id</name>
					<sorting>ascending</sorting>
				</field>
				<field>
					<name>seq</name>
					<sorting>ascending</sorting>
				</field>
			</index>
		</declaration>
	</table>
	
</database>