|
29 | 29 |
|
30 | 30 | Diver.delete_all |
31 | 31 | #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| |
33 | 33 | divers.read.each_line do|diver| |
34 | 34 | DiverNumber, DiverName, UserName, Email, Password, Active, Role = diver.chomp.split(",") |
35 | 35 | Diver.create( :diver_number => DiverNumber, :diver_name => DiverName, :username => UserName, :email => Email, :password => Password, :active => Active, :role => Role ) |
36 | 36 | puts "successfully created #{DiverName}" |
37 | 37 | end |
38 | 38 | end |
39 | 39 |
|
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 |
48 | 48 |
|
49 | 49 | #Coral.delete_all |
50 | 50 | ##Coral.connection.execute( 'ALTER SEQUENCE corals_id_seq RESTART WITH 1' ) |
|
0 commit comments