From 7b86c0f78659f176fa19d24daed718dc99f20d9d Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Mon, 28 Oct 2013 11:15:17 +0100 Subject: [PATCH] MT#4685 Don't tie firmware to profile. That way, you can upload multiple firmwares, and ngcp-panel will serve the next or latest one, depending on the currently running one. --- lib/NGCP/Schema/Result/autoprov_firmwares.pm | 7 ------- lib/NGCP/Schema/Result/autoprov_profiles.pm | 19 ------------------- 2 files changed, 26 deletions(-) diff --git a/lib/NGCP/Schema/Result/autoprov_firmwares.pm b/lib/NGCP/Schema/Result/autoprov_firmwares.pm index 79ed9ddb..4ffc28d0 100644 --- a/lib/NGCP/Schema/Result/autoprov_firmwares.pm +++ b/lib/NGCP/Schema/Result/autoprov_firmwares.pm @@ -40,13 +40,6 @@ __PACKAGE__->belongs_to( { 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 { diff --git a/lib/NGCP/Schema/Result/autoprov_profiles.pm b/lib/NGCP/Schema/Result/autoprov_profiles.pm index 8812a4fd..c00510ad 100644 --- a/lib/NGCP/Schema/Result/autoprov_profiles.pm +++ b/lib/NGCP/Schema/Result/autoprov_profiles.pm @@ -16,13 +16,6 @@ __PACKAGE__->add_columns( 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", @@ -43,18 +36,6 @@ __PACKAGE__->belongs_to( { 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 {