Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-29 00:39:49 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-30 11:44:20 +0300
commit855b2820c16c6e569d5c38b7def8ead18c86cecd (patch)
tree350e7746b0e64c4994a85dd058b9e4af9c3acf3c /db/migrate/20160328112808_create_notification_settings.rb
parent4ca73f56cb59b86f25b55ff02800571fb82c742f (diff)
Improve db migrations for notification settings
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'db/migrate/20160328112808_create_notification_settings.rb')
-rw-r--r--db/migrate/20160328112808_create_notification_settings.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/db/migrate/20160328112808_create_notification_settings.rb b/db/migrate/20160328112808_create_notification_settings.rb
index 88652821ac3..4755da8b806 100644
--- a/db/migrate/20160328112808_create_notification_settings.rb
+++ b/db/migrate/20160328112808_create_notification_settings.rb
@@ -1,10 +1,9 @@
class CreateNotificationSettings < ActiveRecord::Migration
def change
create_table :notification_settings do |t|
- t.integer :user_id
- t.integer :level
- t.integer :source_id
- t.string :source_type
+ t.references :user, null: false
+ t.references :source, polymorphic: true, null: false
+ t.integer :level, default: 0, null: false
t.timestamps null: false
end