Class: Hotdog::Commands::Gc
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Hotdog::Commands::Gc
- Defined in:
- lib/hotdog/commands/gc.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
#application, #formatter, #logger, #options, #tags
Instance Method Summary collapse
Methods inherited from BaseCommand
Constructor Details
This class inherits a constructor from Hotdog::Commands::BaseCommand
Instance Method Details
#run(args = []) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/hotdog/commands/gc.rb', line 6 def run(args=[]) execute(" DELETE FROM hosts WHERE id NOT IN ( SELECT DISTINCT host_id FROM hosts_tags );\n EOS\n execute(<<-EOS)\n DELETE FROM tags WHERE id NOT IN ( SELECT DISTINCT tag_id FROM hosts_tags );\n EOS\nend\n") |