lib/fuzzily/migration.rb in fuzzily-0.3.0 vs lib/fuzzily/migration.rb in fuzzily-0.3.1
- old
+ new
@@ -10,14 +10,22 @@
def trigrams_table_name
@trigrams_table_name ||= :trigrams
end
+ def trigrams_owner_id_column_type=(custom_type)
+ @trigrams_owner_id_column_type = custom_type
+ end
+
+ def trigrams_owner_id_column_type
+ @trigrams_owner_id_column_type ||= :integer
+ end
+
def up
create_table trigrams_table_name do |t|
t.string :trigram, :limit => 3
t.integer :score, :limit => 2
- t.integer :owner_id
+ t.send trigrams_owner_id_column_type, :owner_id
t.string :owner_type
t.string :fuzzy_field
end
# owner_id goes first as we'll GROUP BY that