Show More
Commit Description:
merge with rails7 branch
Commit Description:
merge with rails7 branch
References:
File last commit:
Show/Diff file:
Action:
db/migrate/20090416235658_add_common_ext_to_languages.rb
| 23 lines
| 548 B
| text/x-ruby
| RubyLexer
|
r822 | class AddCommonExtToLanguages < ActiveRecord::Migration[4.2] | |||
|
r166 | def self.up | ||
# language.common_ext is a comma-separated list of common file | ||||
# extensions. | ||||
add_column :languages, :common_ext, :string | ||||
# updating table information | ||||
Language.reset_column_information | ||||
common_ext = { | ||||
'c' => 'c', | ||||
'cpp' => 'cpp,cc', | ||||
'pas' => 'pas' | ||||
} | ||||
r666 | Language.all.each do |lang| | |||
|
r166 | lang.common_ext = common_ext[lang.name] | ||
lang.save | ||||
end | ||||
end | ||||
def self.down | ||||
remove_column :languages, :common_ext | ||||
end | ||||
end | ||||