Created
August 13, 2012 14:35
-
-
Save havvg/3341266 to your computer and use it in GitHub Desktop.
Propel 1.6: Sluggable with I18n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="country"> | |
<column name="id" type="integer" autoIncrement="true" primaryKey="true" /> | |
<column name="iso_code" type="char" size="2" required="true" /> | |
<column name="name" type="varchar" size="255" required="true" primaryString="true" /> | |
<behavior name="i18n"> | |
<parameter name="i18n_columns" value="name, url" /> | |
<parameter name="default_locale" value="de_DE" /> | |
</behavior> | |
<unique> | |
<unique-column name="iso_code" /> | |
</unique> | |
</table> | |
<table name="country_i18n"> | |
<column name="id" type="integer" autoIncrement="false" required="true" primaryKey="true" /> | |
<column name="locale" type="varchar" size="5" required="true" primaryKey="true" /> | |
<behavior name="sluggable"> | |
<parameter name="slug_column" value="url" /> | |
<parameter name="replace_pattern" value="/[^\\pL\\d]+/u" /> | |
</behavior> | |
<foreign-key foreignTable="country" onDelete="CASCADE" onUpdate="CASCADE"> | |
<reference local="id" foreign="id" /> | |
</foreign-key> | |
</table> | |
</database> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment