Class: Arfi::Commands::FIdx
- Inherits:
-
Thor
- Object
- Thor
- Arfi::Commands::FIdx
- Defined in:
- lib/arfi/commands/f_idx.rb
Overview
Arfi::Commands::FIdx module contains commands for manipulating functional index in Rails project.
Instance Method Summary collapse
-
#create(index_name) ⇒ void
Arfi::Commands::FIdx#create -> void.
-
#destroy(index_name, revision = '01') ⇒ void
Arfi::Commands::FIdx#destroy -> void.
Instance Method Details
#create(index_name) ⇒ void
This method returns an undefined value.
Arfi::Commands::FIdx#create -> void
This command is used to create the functional index.
23 24 25 26 27 |
# File 'lib/arfi/commands/f_idx.rb', line 23 def create(index_name) validate_schema_format! content = build_sql_function(index_name) create_index_file(index_name, content) end |
#destroy(index_name, revision = '01') ⇒ void
This method returns an undefined value.
Arfi::Commands::FIdx#destroy -> void
This command is used to delete the functional index.
40 41 42 43 44 45 46 |
# File 'lib/arfi/commands/f_idx.rb', line 40 def destroy(index_name, revision = '01') validate_schema_format! revision = "0#{revision}" if revision.match?(/^\d$/) FileUtils.rm("#{functions_dir}/#{index_name}_v#{revision}.sql") puts "Deleted: #{functions_dir}/#{index_name}_v#{revision}.sql" end |