summaryrefslogtreecommitdiff
path: root/doc/development/creating_enums.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-24 21:06:26 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-24 21:06:26 +0000
commit46bfa73d93786bc2a832be7e42e2119712a0bafb (patch)
treeda48cc5babc92871cda768a980042aeb061c5ace /doc/development/creating_enums.md
parentc4edbefa458319a81e238f8f034d19f6ea6292ca (diff)
downloadgitlab-ce-46bfa73d93786bc2a832be7e42e2119712a0bafb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/creating_enums.md')
-rw-r--r--doc/development/creating_enums.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/development/creating_enums.md b/doc/development/creating_enums.md
new file mode 100644
index 00000000000..64385a2ea79
--- /dev/null
+++ b/doc/development/creating_enums.md
@@ -0,0 +1,15 @@
+# Creating enums
+
+When creating a new enum, it should use the database type `SMALLINT`.
+The `SMALLINT` type size is 2 bytes, which is sufficient for an enum.
+This would help to save space in the database.
+
+To use this type, add `limit: 2` to the migration that creates the column.
+
+Example:
+
+```rb
+def change
+ add_column :ci_job_artifacts, :file_format, :integer, limit: 2
+end
+```