23 lines
475 B
Ruby
23 lines
475 B
Ruby
class CreatePadValues < ActiveRecord::Migration
|
|
include PadImport
|
|
|
|
def self.up
|
|
create_table :pad_values do |t|
|
|
t.integer :product_id, :references => :products
|
|
t.string :key
|
|
t.text :value
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
puts "Migrating existing PAD files to database..."
|
|
Product.all.each do |product|
|
|
import_pad(product) if product.setup_file.file?
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
drop_table :pad_values
|
|
end
|
|
end
|