summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-07-13 12:22:02 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-25 15:12:41 +0200
commit812bfb158b70b09cfd438379a4b9446aa85b52ec (patch)
treeee252f7086632223ecc483967f89d8a7b3014054 /db/migrate
parent3f14c56bfe77e83084b58dc2bd3c34e3c84c6cae (diff)
downloadgitlab-ce-812bfb158b70b09cfd438379a4b9446aa85b52ec.tar.gz
Add the `UserStatus` model
This model will hold the status of a user, including these fields: - emoji: always present, with a default value - user: always present, foreign key to user - message: optional, maximum length of 100 The table also stores - cached_markdown_version - message_html For rendering markdown in the `message` field.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180713092803_create_user_statuses.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20180713092803_create_user_statuses.rb b/db/migrate/20180713092803_create_user_statuses.rb
new file mode 100644
index 00000000000..cbe21b89ad9
--- /dev/null
+++ b/db/migrate/20180713092803_create_user_statuses.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class CreateUserStatuses < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ create_table :user_statuses, id: false, primary_key: :user_id do |t|
+ t.references :user,
+ foreign_key: { on_delete: :cascade },
+ null: false,
+ primary_key: true
+ t.integer :cached_markdown_version, limit: 4
+ t.string :emoji, null: false, default: 'speech_balloon'
+ t.string :message, limit: 100
+ t.string :message_html
+ end
+ end
+end