mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 10:36:22 +00:00
22 lines
489 B
Ruby
22 lines
489 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Crea códigos de conducta
|
|
class AddCodeOfConduct < ActiveRecord::Migration[6.1]
|
|
def up
|
|
create_table :codes_of_conduct do |t|
|
|
t.timestamps
|
|
t.string :title
|
|
t.text :description
|
|
t.text :content
|
|
end
|
|
|
|
# XXX: En lugar de ponerlo en las seeds
|
|
YAML.safe_load(File.read('db/seeds/codes_of_conduct.yml')).each do |coc|
|
|
CodeOfConduct.new(**coc).save!
|
|
end
|
|
end
|
|
|
|
def down
|
|
drop_table :codes_of_conduct
|
|
end
|
|
end
|