9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/generators/keinaufwand/sync/indexes/indexes_generator.rb', line 9
def create_index_migration
manager = Keinaufwand::Sync.configuration.index_manager
operations = manager.migration_operations
if operations.empty?
say "Keinaufwand sync indexes are already up to date."
return
end
migration_number = self.class.next_migration_number(File.join(destination_root, "db/migrate"))
class_name = "UpdateKeinaufwandSyncIndexes#{migration_number}"
source = manager.migration_source(class_name: class_name)
create_file File.join("db/migrate", "#{migration_number}_#{class_name.underscore}.rb"), source
end
|