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

23 lines
493 B
Ruby
Raw Normal View History

2023-03-23 00:01:29 +00:00
# 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