docbrown/db/migrate/20210222102503_create_users_settings.rb
Ridhwana 4848a8b2e1
User Settings Step 1: Add user_settings and user_notification_settings tables (rfc#32) (#12768)
* feat: add the two new models users_setting and users_notification_setting

* feat: add the settings and notification_settings table to the schema

* feat: add the user and notification models

* feat: add the user_id foreign key to the model

* chore: sneaky indent

* feat: add some fields from the profile attributes

* Revert "feat: add some fields from the profile attributes"

This reverts commit 376828746ded063a243505d317140fa5339227cf.

* chore: add some profile field attributes

* chore: remove language_settings

* chore: update indent

* chore: remove language_settings

* feat: changes to the tables

* chore:  remove validation in favor of the foreign keys

* chore: add default for editor version

* Address PR review suggestions

* setting_spec.rb needs to be fixed; need help

* Working on PR review comments

* Continue with addressing PR review comments

* Remove normalize_config_values method; pass correct values from forms

* Address Travis failures

* revert some unnecessary changes in spec file

Co-authored-by: Arit Amana <msarit@gmail.com>
2021-03-31 14:37:46 +02:00

29 lines
1.1 KiB
Ruby

class CreateUsersSettings < ActiveRecord::Migration[6.0]
def change
create_table :users_settings do |t|
t.references :user, foreign_key: true, null: false
t.boolean "display_announcements", default: true, null: false
t.boolean "display_sponsors", default: true, null: false
t.integer "editor_version", default: 0, null: false
t.integer "config_font", default: 0, null: false
t.integer "inbox_type", default: 0, null: false
t.integer "config_navbar", default: 0, null: false
t.integer "config_theme", default: 0, null: false
t.integer "experience_level"
t.boolean "feed_mark_canonical", default: false, null: false
t.boolean "feed_referential_link", default: true, null: false
t.string "feed_url"
t.string "inbox_guidelines"
t.boolean "permit_adjacent_sponsors", default: true
t.string "brand_color1", default: "#000000"
t.string "brand_color2", default: "#ffffff"
t.boolean "display_email_on_profile", default: false, null: false
t.timestamps
end
end
end