<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema SYSTEM "../../dtd/xmlSchema.dtd">

<!--
  * comments.xml
  *
  * Copyright (c) 2013-2016 Simon Fraser University Library
  * Copyright (c) 2000-2016 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Comments schema in XML.
  -->

<schema version="0.2">
	<!--
	 *
	 * TABLE comments
	 *
	 -->
	<table name="comments">
		<field name="comment_id" type="I8">
			<KEY />
			<AUTOINCREMENT/>
		</field>
		<field name="submission_id" type="I8">
			<NOTNULL/>
		</field>
		<field name="parent_comment_id" type="I8"/>
		<field name="num_children" type="I4">
			<NOTNULL/>
			<DEFAULT VALUE="0"/>
		</field>
		<field name="user_id" type="I8"/>
		<field name="poster_ip" type="C2" size="15">
			<NOTNULL/>
		</field>
		<field name="poster_name" type="C2" size="90"/>
		<field name="poster_email" type="C2" size="90"/>
		<field name="title" type="C2" size="255">
			<NOTNULL/>
		</field>
		<field name="body" type="X"/>
		<field name="date_posted" type="T"/>
		<field name="date_modified" type="T"/>
		<descr>Reader comments on articles.</descr>
		<index name="comments_submission_id">
			<col>submission_id</col>
		</index>
		<index name="comments_parent_comment_id">
			<col>parent_comment_id</col>
		</index>
		<index name="comments_user_id">
			<col>user_id</col>
		</index>
	</table>
</schema>
