diff options
Diffstat (limited to 'doc/development/database/creating_enums.md')
-rw-r--r-- | doc/development/database/creating_enums.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/development/database/creating_enums.md b/doc/development/database/creating_enums.md index e2ae36f7481..908656dae84 100644 --- a/doc/development/database/creating_enums.md +++ b/doc/development/database/creating_enums.md @@ -63,7 +63,7 @@ module EE module Pipeline override :failure_reasons def failure_reasons - super.merge(activity_limit_exceeded: 2) + super.merge(job_activity_limit_exceeded: 2) end end end @@ -73,9 +73,9 @@ end This works as-is, however, it has a couple of downside that: - Someone could define a key/value pair in EE that is **conflicted** with a value defined in FOSS. - For example, define `activity_limit_exceeded: 1` in `EE::Enums::Pipeline`. + For example, define `job_activity_limit_exceeded: 1` in `EE::Enums::Pipeline`. - When it happens, the feature works totally different. - For example, we cannot figure out `failure_reason` is either `config_error` or `activity_limit_exceeded`. + For example, we cannot figure out `failure_reason` is either `config_error` or `job_activity_limit_exceeded`. - When it happens, we have to ship a database migration to fix the data integrity, which might be impossible if you cannot recover the original value. @@ -88,7 +88,7 @@ module EE module Pipeline override :failure_reasons def failure_reasons - super.merge(activity_limit_exceeded: 1_000, size_limit_exceeded: 1_001) + super.merge(job_activity_limit_exceeded: 1_000, size_limit_exceeded: 1_001) end end end @@ -98,7 +98,7 @@ end This looks working as a workaround, however, this approach has some downsides that: - Features could move from EE to FOSS or vice versa. Therefore, the offset might be mixed between FOSS and EE in the future. - For example, when you move `activity_limit_exceeded` to FOSS, you see `{ unknown_failure: 0, config_error: 1, activity_limit_exceeded: 1_000 }`. + For example, when you move `job_activity_limit_exceeded` to FOSS, you see `{ unknown_failure: 0, config_error: 1, job_activity_limit_exceeded: 1_000 }`. - The integer column for the `enum` is likely created [as `SMALLINT`](#creating-enums). Therefore, you need to be careful of that the offset doesn't exceed the maximum value of 2 bytes integer. @@ -110,7 +110,7 @@ class Pipeline < ApplicationRecord enum failure_reason: { unknown_failure: 0, config_error: 1, - activity_limit_exceeded: 2 + job_activity_limit_exceeded: 2 } end ``` |