5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 11:31:41 +00:00
panel/db/migrate/20230322231344_add_privacy_policy.rb

22 lines
493 B
Ruby

# frozen_string_literal: true
# Agrega políticas de privacidad
class AddPrivacyPolicy < ActiveRecord::Migration[6.1]
def up
create_table :privacy_policies 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/privacy_policies.yml')).each do |pp|
PrivacyPolicy.new(**pp).save!
end
end
def down
drop_table :privacy_policies
end
end