lib/etl/execution/migration.rb in activewarehouse-etl-0.8.1 vs lib/etl/execution/migration.rb in activewarehouse-etl-0.8.2
- old
+ new
@@ -22,11 +22,11 @@
@connection ||= ETL::Execution::Base.connection
end
# Get the final target version number
def target
- 1
+ 2
end
private
def migration_1 #:nodoc:
connection.create_table :jobs do |t|
@@ -40,9 +40,16 @@
t.column :natural_key, :string, :null => false
t.column :crc, :string, :null => false
t.column :job_id, :integer, :null => false
end
update_schema_info(1)
+ end
+
+ def migration_2 #:nodoc:
+ connection.add_index :records, :control_file
+ connection.add_index :records, :natural_key
+ connection.add_index :records, :job_id
+ update_schema_info(2)
end
# Update the schema info table, setting the version value
def update_schema_info(version)
connection.update("UPDATE #{schema_info_table_name} SET version = #{version}")