Im trying to delete a table and truncate it using the following variations of code. All of the following versions give me the same error.
Code: puts "Clearing Database Table: program_slots" ProgramSlot.destroy_all ActiveRecord::Base.connection.execute("TRUNCATE TABLE program_slots")
puts "Clearing Database Table: program_slots"
ProgramSlot.destroy_all
ActiveRecord::Base.connection.execute("TRUNCATE TABLE PROGRAMSLOTS")
puts "Clearing Database Table: program_slots"
ProgramSlot.destroy_all
ActiveRecord::Base.connection.execute("TRUNCATE TABLE 'program_slots'")
puts "Clearing Database Table: program_slots"
ProgramSlot.destroy_all
ActiveRecord::Base.connection.execute("TRUNCATE TABLE PROGRAM_SLOTS")
The table name is program_slots
The error Im getting is:
>> ProgramSlot Load (0.6ms) SELECT `program_slots`.* FROM `program_slots`
(0.8ms) TRUNCATE TABLE PROGRAMSLOTS
Mysql2::Error: Table 'dd_development.programslots' doesn't exist: TRUNCATE TABLE PROGRAMSLOTS
Whats the right syntax? It seems that the underscore I put in my execute statement is not going through .......Notice the error statement is trying to find a table called "programslots" but the real table name is "program_slots".
How do i fix this?