<commit_before>-- Add a form input under the organisation size question for all competitions and templates. Default is inactive.
-- Financial Year End. Get the form input type and then do an insert for every organisation size question.
SET @financial_year_end_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_YEAR_END');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_year_end_id, q.competition_id, false, "End of last financial year", "Enter the month and year that your last financial year finished.", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';

-- Financial Overview rows.
SET @financial_overview_row_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_OVERVIEW_ROW');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Turnover", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Profit", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Exports", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Research and development spend", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Full time employees", "Number of full time employees at your organisation at the end of the last financial year.", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';

-- Full time employees at year end
SET @financial_staff_count_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_STAFF_COUNT');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_staff_count_id, q.competition_id, false, "Full time employees", "Number of full time employees at your organisation at the end of the last financial year.", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q<commit_msg>INFUND-6395 another fix for the db script<commit_after>-- Add a form input under the organisation size question for all competitions and templates. Default is inactive.
-- Financial Year End. Get the form input type and then do an insert for every organisation size question.
SET @financial_year_end_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_YEAR_END');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_year_end_id, q.competition_id, false, "End of last financial year", "Enter the month and year that your last financial year finished.", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';

-- Financial Overview rows.
SET @financial_overview_row_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_OVERVIEW_ROW');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Turnover", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Profit", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Annual Exports", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_overview_row_id, q.competition_id, false, "Research and development spend", "", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
     WHERE q.name = 'Organisation Size';

-- Full time employees at year end
SET @financial_staff_count_id = (SELECT id FROM form_input_type WHERE `name` =  'FINANCIAL_STAFF_COUNT');
INSERT INTO form_input (word_count, form_input_type_id, competition_id, included_in_application_summary, description, guidance_title, guidance_answer, priority, question_id, scope, active)
     SELECT null, @financial_staff_count_id, q.competition_id, false, "Full time employees", "Number of full time employees at your organisation at the end of the last financial year.", "", (SELECT MAX(priority) + 1 FROM form_input AS fi WHERE q.id = fi.question_id), q.id AS `question_id`, "APPLICATION", false
     FROM question AS q
{'fraction_non_alphanumeric': 0.09124695629885941, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 5.716006884681583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7255395', 'n_tokens_mistral': 2313, 'n_tokens_neox': 2237, 'n_words': 796}