summaryrefslogtreecommitdiff
path: root/doc/development/creating_enums.md
blob: 79ed465b12194efd98f3a9a8a4901bb9a577c108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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:

```ruby
def change
  add_column :ci_job_artifacts, :file_format, :integer, limit: 2
end
```