<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
progresses = Progress.create([{name: 'Unallocated'},{name: 'Allocated Pending'},{name: 'Allocated Accepted'}])<commit_msg>Extended seed to remove existing data, reset PK and populate tables run with rake db:seed<commit_after># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
puts 'Clear tables'
ActiveRecord::Base.connection.execute("TRUNCATE TABLE progresses RESTART IDENTITY;")
ActiveRecord::Base.connection.execute("TRUNCATE TABLE ministers RESTART IDENTITY;")
ActiveRecord::Base.connection.execute("TRUNCATE TABLE directorates RESTART IDENTITY;")
ActiveRecord::Base.connection.execute("TRUNCATE TABLE divisions RESTART IDENTITY;")
ActiveRecord::Base.connection.execute("TRUNCATE TABLE deputy_directors RESTART IDENTITY;")
ActiveRecord::Base.connection.execute("TRUNCATE TABLE action_officers RESTART IDENTITY;")

puts '-populate'
progresses = Progress.create!([{name: 'Unallocated'},{name: 'Allocated Pending'},{name: 'Allocated Accepted'}])
ministers = Minister.create!([
	{name: '<NAME>', email:'<EMAIL>', title: 'Secretary of State and Lord High Chancellor of Great Britain', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Minister of State', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Minister of State', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Parliamentary Under-Secretary of State, Minister for Victims and the Courts (jointly with Government Equalities Office)', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Parliamentary Under-Secretary of State; Minister for Prisons and Rehabilitation', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Permanent Secretary', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Parliamentary Under-Secretary of State', deleted: false},
	{name: 'Ministerial Correspondnece Unit', email:'<EMAIL>', title: 'MCU', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Minister of State for Justice & Civil Liberties', deleted: false},
	{name: '<NAME>', email:'<EMAIL>', title: 'Lord Faulks QC, Minister of State', deleted: false}])

directorates = Directorate.create!([
	{name: 'Finanace Assurance and Commercial', deleted: false},
	{name: 'Criminal Justice', deleted: false},
	{name: 'Law and Access to Justice', deleted: false},
	{name: 'NOMS', deleted: false},
	{name: 'HMCTS', deleted: false},
	{name: 'LAA and Corporate Services', deleted: false},
	])

divisions = Division.create!([
	{directorate_id:  1, name: 'Corporate Finance', deleted: false},
	{directorate_id:  1, name: 'Analytical Services', deleted: false},
	{directorate_id:  1, name: 'Procurement', deleted: false},
	{directorate_id:  1, name: 'Change due diligence', deleted: false},
	{directorate_id:  2, name: 'Sentencing and Rehabilitation Policy', deleted: false},
	{directorate_id:  2, name: 'Justice Reform', deleted: false},
	{directorate_id:  2, name: 'Transforming Rehabilitation', deleted: false},
	{directorate_id:  2, name: 'MoJ Strategy', deleted: false},
	{directorate_id:  3, name: 'Law, Rights, International', deleted: false},
	{directorate_id:  3, name: 'Access to Justice', deleted: false},
	{directorate_id:  3, name: 'Judicial Reward and Pensions reform', deleted: false},
	{directorate_id:  3, name: 'Communications and Information', deleted: false},
	{directorate_id:  4, name: 'HR', deleted: false},
	{directorate_id:  4, name: 'Public Sector Prisons', deleted: false},
	{directorate_id:  5, name: 'Civil, Family and Tribunals', deleted: false},
	{directorate_id:  5, name: 'Crime', deleted: false},
	{directorate_id:  5, name: 'IT', deleted: false},
	{directorate_id:  6, name: 'Shared Services', deleted: false},
	{directorate_id:  6, name: 'MoJ Technology', deleted: false}
	])

deputy_directors = DeputyDirector.create!([
	{division_id: 1, name: '<NAME>', deleted: false},
	{division_id: 2, name: '<NAME>', deleted: false},
	{division_id: 3, name: 'Procurement', deleted: false},
	{division_id: 4, name: '<NAME>', deleted: false},
	{division_id: 5, name: '<NAME>', deleted: false},
	{division_id: 6, name: '<NAME>', deleted: false},
	{division_id: 7, name: '<NAME>', deleted: false},
	{division_id: 8, name: '<NAME>', deleted: false},
	{division_id: 9, name: '<NAME>', deleted: false},
	{division_id: 10, name: 'Vacant', deleted: false},
	{division_id: 11, name: '<NAME>', deleted: false},
	{division_id: 12, name: '<NAME>', deleted: false},
	{division_id: 13, name: '<NAME>', deleted: false},
	{division_id: 14, name: '<NAME>', deleted: false},
	{division_id: 15, name: '<NAME>', deleted: false},
	{division_id: 16, name: '<NAME>', deleted: false},
	{division_id: 17, name: '<NAME>', deleted: false},
	{division_id: 18, name: '<NAME>', deleted: false},
	{division_id: 19, name: '<NAME>', deleted: false}
	])

action_officers = ActionOfficer.create!([
	{deputy_director_id: 17, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 19, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 6, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 7, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 8, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 9, name: '<NAME>', email: '<EMAIL>', deleted: false},
	{deputy_director_id: 10, name: '<NAME>', email: '<EMAIL>', deleted: false}
	])
puts 'Done'
{'fraction_non_alphanumeric': 0.17137602407624142, 'fraction_numerical': 0.009697375020899516, 'mean_word_length': 6.515075376884422, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, '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': '5340497', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1956, 'n_words': 634}