Skip to content

Instantly share code, notes, and snippets.

@havvg
Created June 6, 2012 12:53
Show Gist options
  • Select an option

  • Save havvg/2881652 to your computer and use it in GitHub Desktop.

Select an option

Save havvg/2881652 to your computer and use it in GitHub Desktop.
Propel 1.6: Archivable with Versionable
<?xml version="1.0" encoding="UTF-8"?>
<database name="default" defaultIdMethod="native" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd">
<table name="entry" phpName="Entry">
<column name="id" type="integer" autoIncrement="true" primaryKey="true" />
<column name="value" type="varchar" size="255" required="true" />
<behavior name="archivable">
<parameter name="archive_on_insert" value="true" />
<parameter name="archive_on_update" value="true" />
<parameter name="archive_on_delete" value="true" />
<parameter name="log_archived_at" value="false" />
</behavior>
</table>
<table name="entry_archive" phpName="EntryArchive">
<column name="id" type="integer" autoIncrement="false" primaryKey="true" />
<column name="value" type="varchar" size="255" required="true" />
<column name="archived_at" type="timestamp" />
<behavior name="versionable">
<parameter name="log_created_at" value="true" />
<parameter name="log_created_by" value="true" />
<parameter name="log_comment" value="true" />
</behavior>
</table>
</database>
@havvg
Copy link
Copy Markdown
Author

havvg commented Jun 11, 2012

In addition it also allows the deletion of every version with ease: you just delete the archive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment