forgeplus/db/migrate/20191218023731_create_proje...

18 lines
526 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
class CreateProjectLanguages < ActiveRecord::Migration[5.2]
def change
create_table :project_languages do |t|
t.string :name
t.integer :position
t.integer :projects_count, :default => 0
t.timestamps
end
names = %w(Ruby C C# C++ HTML Haml CSS JavaScript Python PHP Java JSON JSX Lex Shell Objective-C Cycript Clojure Go Grace Gradle GraphQL Dart Elixir Erlang Perl R Reason Sass Slice SVG)
names.each do |name|
ProjectLanguage.find_or_create_by!(name: name)
end
end
end