diff --git a/lib/NGCP/Schema/Result/autoprov_configs.pm b/lib/NGCP/Schema/Result/autoprov_configs.pm new file mode 100644 index 00000000..891c4d58 --- /dev/null +++ b/lib/NGCP/Schema/Result/autoprov_configs.pm @@ -0,0 +1,139 @@ +package NGCP::Schema::Result::autoprov_configs; +use Sipwise::Base; +use MooseX::NonMoose; +use Scalar::Util qw(blessed); +our $VERSION = '2.004'; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + + + +extends 'DBIx::Class::Core'; + + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + + +__PACKAGE__->table("provisioning.autoprov_configs"); + + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "device_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "version", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "content_type", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "data", + { data_type => "mediumtext", is_nullable => 0 }, +); + + +__PACKAGE__->set_primary_key("id"); + + +__PACKAGE__->belongs_to( + "device", + "NGCP::Schema::Result::autoprov_devices", + { id => "device_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +__PACKAGE__->has_many( + "autoprov_profiles", + "NGCP::Schema::Result::autoprov_profiles", + { "foreign.firmware_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::provisioning::Result::autoprov_configs + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 device_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 version + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 data + + data_type: 'mediumtext' + is_nullable: 0 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 RELATIONS + +=head2 device + +Type: belongs_to + +Related object: L + +=cut + + +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-09 18:26:38 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rr7y7bh33fX3UgE8IXLl5w + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/NGCP/Schema/Result/autoprov_devices.pm b/lib/NGCP/Schema/Result/autoprov_devices.pm new file mode 100644 index 00000000..719c5286 --- /dev/null +++ b/lib/NGCP/Schema/Result/autoprov_devices.pm @@ -0,0 +1,140 @@ +package NGCP::Schema::Result::autoprov_devices; +use Sipwise::Base; +use MooseX::NonMoose; +use Scalar::Util qw(blessed); +our $VERSION = '2.004'; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + + + +extends 'DBIx::Class::Core'; + + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + + +__PACKAGE__->table("provisioning.autoprov_devices"); + + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "reseller_id", + { data_type => "integer", extra => { unsigned => 1 }, is_nullable => 0 }, + "vendor", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "model", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "front_image", + { data_type => "mediumblob", is_nullable => 1 }, + "front_image_type", + { data_type => "varchar", is_nullable => 0, size => 32 }, + "mac_image", + { data_type => "mediumblob", is_nullable => 1 }, + "mac_image_type", + { data_type => "varchar", is_nullable => 0, size => 32 }, +); + +__PACKAGE__->belongs_to( + "reseller", + "NGCP::Schema::Result::resellers", + { id => "reseller_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + } +); + +__PACKAGE__->has_many( + "autoprov_firmwares", + "NGCP::Schema::Result::autoprov_firmwares", + { "foreign.device_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->has_many( + "autoprov_configs", + "NGCP::Schema::Result::autoprov_configs", + { "foreign.device_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->set_primary_key("id"); +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::provisioning::Result::autoprov_devices + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 reseller_id + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 0 + +=head2 vendor + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 model + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + + +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-09 12:29:48 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fFY/6TuWLmvWIb9jDVyYFA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/NGCP/Schema/Result/autoprov_field_devices.pm b/lib/NGCP/Schema/Result/autoprov_field_devices.pm new file mode 100644 index 00000000..08538d84 --- /dev/null +++ b/lib/NGCP/Schema/Result/autoprov_field_devices.pm @@ -0,0 +1,150 @@ +package NGCP::Schema::Result::autoprov_field_devices; +use Sipwise::Base; +use MooseX::NonMoose; +use Scalar::Util qw(blessed); +our $VERSION = '2.004'; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + + + +extends 'DBIx::Class::Core'; + + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + + +__PACKAGE__->table("provisioning.autoprov_field_devices"); + + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "subscriber_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "profile_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "identifier", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + + +__PACKAGE__->set_primary_key("id"); +__PACKAGE__->add_unique_constraint("uk_identifier_idx", ["identifier"]); + + +__PACKAGE__->belongs_to( + "profile", + "NGCP::Schema::Result::autoprov_profiles", + { id => "profile_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +__PACKAGE__->belongs_to( + "provisioning_voip_subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { id => "subscriber_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::provisioning::Result::autoprov_field_devices + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 subscriber_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 profile_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 identifier + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 RELATIONS + +=head2 profile + +Type: belongs_to + +Related object: L + +=head2 subscriber + +Type: belongs_to + +Related object: L + +=cut + + +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-13 15:15:24 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nPg7ocQR/hxOrPWVhmsyQA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/NGCP/Schema/Result/autoprov_firmwares.pm b/lib/NGCP/Schema/Result/autoprov_firmwares.pm new file mode 100644 index 00000000..19a59933 --- /dev/null +++ b/lib/NGCP/Schema/Result/autoprov_firmwares.pm @@ -0,0 +1,130 @@ +package NGCP::Schema::Result::autoprov_firmwares; +use Sipwise::Base; +use MooseX::NonMoose; +use Scalar::Util qw(blessed); +our $VERSION = '2.004'; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + + + +extends 'DBIx::Class::Core'; + + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + + +__PACKAGE__->table("provisioning.autoprov_firmwares"); + + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "device_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "filename", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "data", + { data_type => "longblob", is_nullable => 0 }, +); + + +__PACKAGE__->set_primary_key("id"); + + +__PACKAGE__->belongs_to( + "device", + "NGCP::Schema::Result::autoprov_devices", + { id => "device_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +__PACKAGE__->has_many( + "autoprov_profiles", + "NGCP::Schema::Result::autoprov_profiles", + { "foreign.firmware_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::provisioning::Result::autoprov_firmwares + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 device_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 data + + data_type: 'longblob' + is_nullable: 0 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 RELATIONS + +=head2 device + +Type: belongs_to + +Related object: L + +=cut + + +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-09 16:43:11 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HXEGelcjENvGXpVeIfpWOw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/NGCP/Schema/Result/autoprov_profiles.pm b/lib/NGCP/Schema/Result/autoprov_profiles.pm new file mode 100644 index 00000000..34fdce90 --- /dev/null +++ b/lib/NGCP/Schema/Result/autoprov_profiles.pm @@ -0,0 +1,154 @@ +package NGCP::Schema::Result::autoprov_profiles; +use Sipwise::Base; +use MooseX::NonMoose; +use Scalar::Util qw(blessed); +our $VERSION = '2.004'; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + + + +extends 'DBIx::Class::Core'; + + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + + +__PACKAGE__->table("provisioning.autoprov_profiles"); + + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "firmware_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 1, + }, + "config_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + + +__PACKAGE__->set_primary_key("id"); + + +__PACKAGE__->belongs_to( + "config", + "NGCP::Schema::Result::autoprov_configs", + { id => "config_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +__PACKAGE__->belongs_to( + "firmware", + "NGCP::Schema::Result::autoprov_firmwares", + { id => "firmware_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::provisioning::Result::autoprov_profiles + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 firmware_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 1 + +=head2 config_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 RELATIONS + +=head2 config + +Type: belongs_to + +Related object: L + +=head2 firmware + +Type: belongs_to + +Related object: L + +=cut + + +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-09 22:49:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c7ukjLDxp+bOS99nHMBm6A + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm b/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm index 5aa2a886..da970e9d 100644 --- a/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm +++ b/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm @@ -190,6 +190,13 @@ __PACKAGE__->belongs_to( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->has_many( + "autoprov_field_devices", + "NGCP::Schema::Result::autoprov_field_devices", + { "foreign.subscriber_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + sub TO_JSON { my ($self) = @_; return { diff --git a/lib/NGCP/Schema/Result/resellers.pm b/lib/NGCP/Schema/Result/resellers.pm index b9a0ab08..fbd53c22 100644 --- a/lib/NGCP/Schema/Result/resellers.pm +++ b/lib/NGCP/Schema/Result/resellers.pm @@ -155,6 +155,13 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->has_many( + "autoprov_devices", + "NGCP::Schema::Result::autoprov_devices", + { "foreign.reseller_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + sub TO_JSON { my ($self) = @_; return {