Sha256: 1806ca247e787590414b02d7aba8ca77fbdeef07a7f4ef27fe0855dc7314f6e7

Contents?: true

Size: 1.13 KB

Versions: 31

Compression:

Stored size: 1.13 KB

Contents

module SportDb

  class Deleter
    ######
    # NB: make models available in sportdb module by default with namespace
    #  e.g. lets you use Team instead of Model::Team
    include SportDb::Models

    def run
      # for now delete all tables
      
      ## stats
      AlltimeStandingEntry.delete_all
      AlltimeStanding.delete_all
      GroupStandingEntry.delete_all
      GroupStanding.delete_all


      Goal.delete_all

      Game.delete_all
      Event.delete_all
      EventTeam.delete_all
      EventGround.delete_all
      Group.delete_all
      GroupTeam.delete_all
      Round.delete_all
      Badge.delete_all

      Roster.delete_all

      Team.delete_all
      
      League.delete_all
      Season.delete_all
      
      Ground.delete_all   # stadiums
      
      Assoc.delete_all       # associations / organizations
      AssocAssoc.delete_all  # associations / organizations

## note: moved to racing.db - delete/remove!!!
##      Record.delete_all
##      Run.delete_all
##      Race.delete_all
##      Track.delete_all
    end
    
  end # class Deleter
  
end # module SportDb

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
sportdb-models-1.18.1 lib/sportdb/deleter.rb
sportdb-models-1.18.0 lib/sportdb/deleter.rb
sportdb-models-1.17.0 lib/sportdb/deleter.rb
sportdb-models-1.16.2 lib/sportdb/deleter.rb
sportdb-models-1.16.1 lib/sportdb/deleter.rb
sportdb-models-1.16.0 lib/sportdb/deleter.rb
sportdb-models-1.15.2 lib/sportdb/deleter.rb
sportdb-models-1.15.1 lib/sportdb/deleter.rb
sportdb-models-1.15.0 lib/sportdb/deleter.rb
sportdb-models-1.14.2 lib/sportdb/deleter.rb
sportdb-models-1.14.1 lib/sportdb/deleter.rb
sportdb-models-1.14.0 lib/sportdb/deleter.rb
sportdb-models-1.13.0 lib/sportdb/deleter.rb
sportdb-models-1.12.0 lib/sportdb/deleter.rb
sportdb-models-1.11.2 lib/sportdb/deleter.rb
sportdb-models-1.11.1 lib/sportdb/deleter.rb
sportdb-models-1.11.0 lib/sportdb/deleter.rb
sportdb-models-1.10.1 lib/sportdb/deleter.rb
sportdb-models-1.10.0 lib/sportdb/deleter.rb
sportdb-1.9.16 lib/sportdb/deleter.rb