Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddConstraintsToAssets < ActiveRecord::Migration
- def self.up
- execute "alter table #{Asset.table_name}
- add constraint assets_check_kind
- check (kind in (#{ Asset::KINDS.collect{|a| "'#{a}'"}.join(',') }));".to_line
- end
- def self.down
- execute "alter table #{Asset.table_name}
- drop constraint assets_check_kind;".to_line
- end
- end
Add Comment
Please, Sign In to add comment