From e8505bf6d35d924ec20244a9281f09926f68b470 Mon Sep 17 00:00:00 2001 From: Kaitlyn Parkhurst Date: Wed, 9 Nov 2022 07:16:14 -0800 Subject: [PATCH] More DB stuff. --- DB/lib/MJB/DB/Result/Invite.pm | 112 ++++++++++++++++++++++ DB/lib/MJB/DB/Result/Person.pm | 34 ++++++- DB/lib/MJB/DB/Result/PersonNote.pm | 144 +++++++++++++++++++++++++++++ DB/lib/MJB/DB/Result/SystemNote.pm | 111 ++++++++++++++++++++++ 4 files changed, 399 insertions(+), 2 deletions(-) create mode 100644 DB/lib/MJB/DB/Result/Invite.pm create mode 100644 DB/lib/MJB/DB/Result/PersonNote.pm create mode 100644 DB/lib/MJB/DB/Result/SystemNote.pm diff --git a/DB/lib/MJB/DB/Result/Invite.pm b/DB/lib/MJB/DB/Result/Invite.pm new file mode 100644 index 0000000..f764ad4 --- /dev/null +++ b/DB/lib/MJB/DB/Result/Invite.pm @@ -0,0 +1,112 @@ +use utf8; +package MJB::DB::Result::Invite; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +MJB::DB::Result::Invite + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime", "InflateColumn::Serializer"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("invite"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'invite_id_seq' + +=head2 code + + data_type: 'text' + is_nullable: 0 + +=head2 is_active + + data_type: 'boolean' + default_value: true + is_nullable: 0 + +=head2 is_one_time_use + + data_type: 'boolean' + default_value: true + is_nullable: 0 + +=head2 created_at + + data_type: 'timestamp with time zone' + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "invite_id_seq", + }, + "code", + { data_type => "text", is_nullable => 0 }, + "is_active", + { data_type => "boolean", default_value => \"true", is_nullable => 0 }, + "is_one_time_use", + { data_type => "boolean", default_value => \"true", is_nullable => 0 }, + "created_at", + { + data_type => "timestamp with time zone", + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fKY1dtin3SHa2Elljm4C9Q + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/DB/lib/MJB/DB/Result/Person.pm b/DB/lib/MJB/DB/Result/Person.pm index 1d94087..8f246a9 100644 --- a/DB/lib/MJB/DB/Result/Person.pm +++ b/DB/lib/MJB/DB/Result/Person.pm @@ -201,6 +201,36 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 person_note_people + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "person_note_people", + "MJB::DB::Result::PersonNote", + { "foreign.person_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 person_note_sources + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "person_note_sources", + "MJB::DB::Result::PersonNote", + { "foreign.source_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 person_settings Type: has_many @@ -232,8 +262,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-15 21:45:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H5AJ0pMQgh7bHRBH3sC4hA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B/Ye097ytw5NsHzVYuJgtQ use Data::GUID; diff --git a/DB/lib/MJB/DB/Result/PersonNote.pm b/DB/lib/MJB/DB/Result/PersonNote.pm new file mode 100644 index 0000000..bfa6069 --- /dev/null +++ b/DB/lib/MJB/DB/Result/PersonNote.pm @@ -0,0 +1,144 @@ +use utf8; +package MJB::DB::Result::PersonNote; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +MJB::DB::Result::PersonNote + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime", "InflateColumn::Serializer"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("person_note"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'person_note_id_seq' + +=head2 person_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 source_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 content + + data_type: 'text' + is_nullable: 1 + +=head2 created_at + + data_type: 'timestamp with time zone' + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "person_note_id_seq", + }, + "person_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "source_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "content", + { data_type => "text", is_nullable => 1 }, + "created_at", + { + data_type => "timestamp with time zone", + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 person + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "person", + "MJB::DB::Result::Person", + { id => "person_id" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, +); + +=head2 source + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "source", + "MJB::DB::Result::Person", + { id => "source_id" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mKX96r3xdfqqYNDSro14Hg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/DB/lib/MJB/DB/Result/SystemNote.pm b/DB/lib/MJB/DB/Result/SystemNote.pm new file mode 100644 index 0000000..b602740 --- /dev/null +++ b/DB/lib/MJB/DB/Result/SystemNote.pm @@ -0,0 +1,111 @@ +use utf8; +package MJB::DB::Result::SystemNote; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +MJB::DB::Result::SystemNote + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime", "InflateColumn::Serializer"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("system_note"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'system_note_id_seq' + +=head2 is_read + + data_type: 'boolean' + default_value: false + is_nullable: 0 + +=head2 source + + data_type: 'text' + is_nullable: 1 + +=head2 content + + data_type: 'text' + is_nullable: 1 + +=head2 created_at + + data_type: 'timestamp with time zone' + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "system_note_id_seq", + }, + "is_read", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, + "source", + { data_type => "text", is_nullable => 1 }, + "content", + { data_type => "text", is_nullable => 1 }, + "created_at", + { + data_type => "timestamp with time zone", + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-09 15:14:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zJbvo73sRKwhcGgq5h4TYw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1;