Skip to content

Instantly share code, notes, and snippets.

@davidjmemmett
Created December 8, 2011 18:46
Show Gist options
  • Save davidjmemmett/1448004 to your computer and use it in GitHub Desktop.
Save davidjmemmett/1448004 to your computer and use it in GitHub Desktop.
multiple aggregate_column behaviours in Propel
ALTER TABLE `table_1` ADD
(
`nb_something_else` INTEGER
);
ALTER TABLE `table_1` ADD
(
`nb_something` INTEGER,
`nb_something_else` INTEGER
);
<table name="table_1">
<behavior name="auto_add_pk" />
<behavior name="aggregate_column">
<parameter name="name" value="nb_something"/>
<parameter name="foreign_table" value="table_2"/>
<parameter name="expression" value="COUNT(id)"/>
</behavior>
<behavior name="aggregate_column">
<parameter name="name" value="nb_something_else"/>
<parameter name="foreign_table" value="table_3"/>
<parameter name="expression" value="COUNT(id)"/>
</behavior>
<column name="name" type="VARCHAR" size="255" required="true" />
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment