diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-03 19:14:55 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-03 19:14:55 +0100 |
commit | a9f1e35a56307472d59684d119750eee6af61025 (patch) | |
tree | d5e6e9706fe5aa717a195a4793bd03b9fdd84ca7 /perllib/FixMyStreet/DB/Result/Alert.pm | |
parent | d07bd0a10d8507c3952f81dcd7fdb251bec164c0 (diff) |
Add alert_sent and alert_type to DBIx::Class.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Alert.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Alert.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index e0017b94d..b99c83a45 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -45,15 +45,27 @@ __PACKAGE__->add_columns( ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( + "alert_type", + "FixMyStreet::DB::Result::AlertType", + { ref => "alert_type" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); +__PACKAGE__->belongs_to( "user", "FixMyStreet::DB::Result::User", { id => "user_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +__PACKAGE__->has_many( + "alert_sents", + "FixMyStreet::DB::Result::AlertSent", + { "foreign.alert_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-24 15:32:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MV8kPZiQVJH7coYT4FmXLg +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-06-03 16:48:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NlyhWyg0NrH5/kZYYO36qg # You can replace this text with custom code or comments, and it will be preserved on regeneration |