# HG changeset patch # User Vincent Tondellier # Date 1443386666 -7200 # Node ID 6a33901e272175bcd9cf64064f366a5ec7d61db4 # Parent e3912669678c5328ec1daa1ab0af3f4b2337aa6e Rename table crash_datas to crash_report_datas diff -r e3912669678c -r 6a33901e2721 dbicdh/PostgreSQL/deploy/2/002-extract_crashing_functions.sql --- a/dbicdh/PostgreSQL/deploy/2/002-extract_crashing_functions.sql Thu Sep 24 01:49:55 2015 +0200 +++ b/dbicdh/PostgreSQL/deploy/2/002-extract_crashing_functions.sql Sun Sep 27 22:44:26 2015 +0200 @@ -16,7 +16,7 @@ -- Used for searching function in the crashing thread backtrace -- Search will be really slow if this index is not present -CREATE INDEX crash_datas_idx_extract_crashing_functions ON crash_datas USING gin ( - extract_crashing_functions(processed) gin_trgm_ops +CREATE INDEX crash_report_datas_idx_extract_crashing_functions ON crash_report_datas USING gist ( + extract_crashing_functions(processed) gist_trgm_ops ); diff -r e3912669678c -r 6a33901e2721 lib/CrashTest/Storage/Sql.pm --- a/lib/CrashTest/Storage/Sql.pm Thu Sep 24 01:49:55 2015 +0200 +++ b/lib/CrashTest/Storage/Sql.pm Sun Sep 27 22:44:26 2015 +0200 @@ -68,7 +68,7 @@ $dbic_query, { prefetch => 'product', - join => [ qw/crash_user crash_data/ ], + join => [ qw/crash_user crash_report_data/ ], '+select' => \@select, '+as' => \@sel_as, order_by => { -desc => 'crash_time' }, @@ -147,7 +147,7 @@ } my $txt_json = j($pjson); - $crash->create_related('crash_data', { + $crash->create_related('crash_report_data', { processed => $txt_json, }); @@ -166,10 +166,10 @@ my $crash = $self->{schema}->resultset('CrashReport')->search( { uuid => $uuid }, - { prefetch => 'crash_data' } + { prefetch => 'crash_report_data' } )->first(); - return decode_json($crash->crash_data->processed); + return decode_json($crash->crash_report_data->processed); } 1; diff -r e3912669678c -r 6a33901e2721 lib/CrashTest/Storage/Sql/Schema/Result/CrashData.pm --- a/lib/CrashTest/Storage/Sql/Schema/Result/CrashData.pm Thu Sep 24 01:49:55 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -package CrashTest::Storage::Sql::Schema::Result::CrashData; - -use CrashTest::Storage::Sql::Schema::Candy; - -primary_column id => { - data_type => 'int', - is_auto_increment => 1, -}; - -column processed => { - data_type => 'jsonb', -}; - -column crash_report_id => { data_type => 'int' }; -belongs_to crash_report => 'CrashTest::Storage::Sql::Schema::Result::CrashReport', 'crash_report_id'; - -1; diff -r e3912669678c -r 6a33901e2721 lib/CrashTest/Storage/Sql/Schema/Result/CrashReport.pm --- a/lib/CrashTest/Storage/Sql/Schema/Result/CrashReport.pm Thu Sep 24 01:49:55 2015 +0200 +++ b/lib/CrashTest/Storage/Sql/Schema/Result/CrashReport.pm Sun Sep 27 22:44:26 2015 +0200 @@ -43,7 +43,7 @@ is_nullable => 1, }; -has_one crash_data => 'CrashTest::Storage::Sql::Schema::Result::CrashData', 'crash_report_id'; +has_one crash_report_data => 'CrashTest::Storage::Sql::Schema::Result::CrashReportData', 'crash_report_id'; column crash_user_id => { data_type => 'int' }; belongs_to crash_user => 'CrashTest::Storage::Sql::Schema::Result::CrashUser', 'crash_user_id'; diff -r e3912669678c -r 6a33901e2721 lib/CrashTest/Storage/Sql/Schema/Result/CrashReportData.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/CrashTest/Storage/Sql/Schema/Result/CrashReportData.pm Sun Sep 27 22:44:26 2015 +0200 @@ -0,0 +1,30 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +package CrashTest::Storage::Sql::Schema::Result::CrashReportData; + +use CrashTest::Storage::Sql::Schema::Candy; + +primary_column id => { + data_type => 'int', + is_auto_increment => 1, +}; + +column processed => { + data_type => 'jsonb', +}; + +column crash_report_id => { data_type => 'int' }; +belongs_to crash_report => 'CrashTest::Storage::Sql::Schema::Result::CrashReport', 'crash_report_id'; + +1;