Bug 13535: DBIC schema changes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 8 Oct 2020 14:17:42 +0000 (16:17 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 8 Oct 2020 14:18:19 +0000 (16:18 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Schema/Result/Alert.pm
Koha/Schema/Result/Borrower.pm

index 2fae361..2db464d 100644 (file)
@@ -33,6 +33,7 @@ __PACKAGE__->table("alert");
 
   data_type: 'integer'
   default_value: 0
+  is_foreign_key: 1
   is_nullable: 0
 
 =head2 type
@@ -55,7 +56,12 @@ __PACKAGE__->add_columns(
   "alertid",
   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
   "borrowernumber",
-  { data_type => "integer", default_value => 0, is_nullable => 0 },
+  {
+    data_type      => "integer",
+    default_value  => 0,
+    is_foreign_key => 1,
+    is_nullable    => 0,
+  },
   "type",
   { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
   "externalid",
@@ -74,9 +80,26 @@ __PACKAGE__->add_columns(
 
 __PACKAGE__->set_primary_key("alertid");
 
+=head1 RELATIONS
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O4b7dlkDRkE6WLPKI5AO+A
+=head2 borrowernumber
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Borrower>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "borrowernumber",
+  "Koha::Schema::Result::Borrower",
+  { borrowernumber => "borrowernumber" },
+  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-08 14:17:29
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jWeIEKGNHlVEBUGBuUXsug
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
index a80a1b8..8c2dcc2 100644 (file)
@@ -722,6 +722,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 alerts
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Alert>
+
+=cut
+
+__PACKAGE__->has_many(
+  "alerts",
+  "Koha::Schema::Result::Alert",
+  { "foreign.borrowernumber" => "self.borrowernumber" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 api_keys
 
 Type: has_many
@@ -1668,8 +1683,8 @@ Composing rels: L</aqorder_users> -> ordernumber
 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-07-20 10:54:51
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pH5cKJCrjwfiLnk7iCO4tA
+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-08 14:17:29
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kzx7ildKCEFF6YDr6MRCrw
 
 __PACKAGE__->add_columns(
     '+anonymized'    => { is_boolean => 1 },