Sha256: a209e04461d313268933db5c144b15f4cab0945ed547f7d11c846577ab620943

Contents?: true

Size: 1 KB

Versions: 5

Compression:

Stored size: 1 KB

Contents

module SportDb

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

    def run
      # for now delete all tables

      ## stats
      AlltimeStandingEntry.delete_all
      AlltimeStanding.delete_all
      GroupStandingEntry.delete_all
      GroupStanding.delete_all


      Goal.delete_all

      Match.delete_all
      Event.delete_all
      EventTeam.delete_all
      EventGround.delete_all
      Group.delete_all
      GroupTeam.delete_all
      Stage.delete_all
      StageTeam.delete_all
      Round.delete_all
      Badge.delete_all

      Lineup.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
    end

  end # class Deleter

end # module SportDb

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sportdb-models-2.1.0 lib/sportdb/models/deleter.rb
sportdb-models-2.0.3 lib/sportdb/models/deleter.rb
sportdb-models-2.0.2 lib/sportdb/models/deleter.rb
sportdb-models-2.0.1 lib/sportdb/models/deleter.rb
sportdb-models-2.0.0 lib/sportdb/models/deleter.rb