Skip to content

Commit 2429682

Browse files
committed
edit seed script
1 parent 4f9ede5 commit 2429682

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

db/seeds.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929

3030
Diver.delete_all
3131
#Diver.connection.execute( 'ALTER SEQUENCE divers_id_seq RESTART WITH 1' )
32-
open("#{Rails.root}/db/SupportData/NCRMP_Divers.csv") do |divers|
32+
open("#{Rails.root}/db/SupportData/ncrmp_diverlist_2024.csv") do |divers|
3333
divers.read.each_line do|diver|
3434
DiverNumber, DiverName, UserName, Email, Password, Active, Role = diver.chomp.split(",")
3535
Diver.create( :diver_number => DiverNumber, :diver_name => DiverName, :username => UserName, :email => Email, :password => Password, :active => Active, :role => Role )
3636
puts "successfully created #{DiverName}"
3737
end
3838
end
3939

40-
#Animal.delete_all
41-
##Animal.connection.execute( 'ALTER SEQUENCE animals_id_seq RESTART WITH 1' )
42-
#open("#{Rails.root}/db/SupportData/Fish_SpeciesList_2019.csv") do |animals|
43-
#animals.read.each_line do |animal|
44-
#SppCode, ScientificName, CommonName, MinSize, MaxSize, MaxNumber = animal.chomp.split(",")
45-
#Animal.create( :species_code => SppCode, :scientific_name => ScientificName, :common_name => CommonName, :min_size => MinSize, :max_size => MaxSize, :max_number => MaxNumber )
46-
#end
47-
#end
40+
Animal.delete_all
41+
#Animal.connection.execute( 'ALTER SEQUENCE animals_id_seq RESTART WITH 1' )
42+
open("{Rails.root}/db/SupportData/fish_species_list_2024.csv") do |animals|
43+
animals.read.each_line do |animal|
44+
SppCode, ScientificName, CommonName, MinSize, MaxSize, MaxNumber = animal.chomp.split(",")
45+
Animal.create( :species_code => SppCode, :scientific_name => ScientificName, :common_name => CommonName, :min_size => MinSize, :max_size => MaxSize, :max_number => MaxNumber )
46+
end
47+
end
4848

4949
#Coral.delete_all
5050
##Coral.connection.execute( 'ALTER SEQUENCE corals_id_seq RESTART WITH 1' )

0 commit comments

Comments
 (0)