5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 12:56:21 +00:00
panel/db/migrate/20230322214924_add_code_of_conduct.rb

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