discourse/db/migrate/20230207093514_create_category_settings.rb
Ted Johansson a90ad52dff
DEV: Add dedicated category settings model - Part 1 (#20211)
This is the first in a multi-part change to move the custom fields to a new table. It includes:

- Adding a new CategorySetting model and corresponding table.
- Populating it with data from the category_custom_fields table.
2023-02-13 12:37:59 +08:00

18 lines
517 B
Ruby

# frozen_string_literal: true
class CreateCategorySettings < ActiveRecord::Migration[7.0]
def change
# Moving the custom fields in core into a dedicated table for
# better type casting, validations, etc.
create_table :category_settings do |t|
t.references :category, null: false, index: { unique: true }
t.boolean :require_topic_approval, null: true
t.boolean :require_reply_approval, null: true
t.integer :num_auto_bump_daily, null: true
t.timestamps
end
end
end