diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/handlemail-support | 1 | ||||
-rwxr-xr-x | bin/update-schema | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/bin/handlemail-support b/bin/handlemail-support index 76fcb4f4e..975773bd9 100755 --- a/bin/handlemail-support +++ b/bin/handlemail-support @@ -22,6 +22,7 @@ BEGIN { } use FixMyStreet; +use FixMyStreet::Email::Sender; use mySociety::HandleMail; my %data = mySociety::HandleMail::get_message(); diff --git a/bin/update-schema b/bin/update-schema index a2f20c306..1e1afa72c 100755 --- a/bin/update-schema +++ b/bin/update-schema @@ -212,6 +212,8 @@ else { # (assuming schema change files are never half-applied, which should be the case) sub get_db_version { return 'EMPTY' if ! table_exists('problem'); + return '0065' if constraint_contains('admin_log_object_type_check', 'moderation'); + return '0064' if index_exists('moderation_original_data_problem_id_comment_id_idx'); return '0063' if column_exists('moderation_original_data', 'extra'); return '0062' if column_exists('users', 'created'); return '0061' if column_exists('body', 'extra'); @@ -320,3 +322,9 @@ sub function_exists { my $fn = shift; return $db->dbh->selectrow_array('select count(*) from pg_proc where proname = ?', {}, $fn); } + +# Returns true if an index exists +sub index_exists { + my $idx = shift; + return $db->dbh->selectrow_array('select count(*) from pg_indexes where indexname = ?', {}, $idx); +} |