diff --git a/app/libs/bugm_host.rb b/app/libs/bugm_host.rb index a7fc2a27..a2d4fcfb 100644 --- a/app/libs/bugm_host.rb +++ b/app/libs/bugm_host.rb @@ -20,7 +20,12 @@ def reset def reset_postgres tables = %w(Tracker User Offer Escrow Position Amendment Contract Event) - tables.each {|el| Object.const_get(el).destroy_all} + tables.each {|el| + Object.const_get(el).destroy_all + # reset the IDs + sql = "TRUNCATE TABLE #{Object.const_get(el).table_name} RESTART IDENTITY;" + ActiveRecord::Base.connection.execute(sql) + } BugmTime.clear_offset PayproCmd::Create.new({}) UserCmd::Create.new({email: 'admin@bugmark.net', password: 'bugmark'}).project