Add topic creation

This commit is contained in:
Rumperuu 2021-03-21 16:34:08 +00:00
parent abcf16497f
commit 13188d49a1
15 changed files with 5315 additions and 35 deletions

View file

@ -124,6 +124,13 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
__PACKAGE__->has_many(
"topics",
"Pear::LocalLoop::Schema::Result::Topic",
{ "foreign.organisation_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
__PACKAGE__->filter_column(
pending => {
filter_to_storage => 'to_bool',

View file

@ -21,6 +21,11 @@ __PACKAGE__->add_columns(
is_auto_increment => 1,
is_nullable => 0,
},
"organisation_id" => {
data_type => "integer",
is_foreign_key => 1,
is_nullable => 1,
},
"name" => {
data_type => "varchar",
size => 200,
@ -30,6 +35,13 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to(
"organisation",
"Pear::LocalLoop::Schema::Result::Organisation",
{ id => "organisation_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
__PACKAGE__->has_many(
"device_subscriptions",
"Pear::LocalLoop::Schema::Result::DeviceSubscription",