Drop default value on status column in deployments table
What does this MR do?
Currently, when you load rails application (e.g. via bundle exec rspec
), you will see the following warning.
Both Deployment and its :status machine have defined a different default for "status". Use only one or the other for defining defaults to avoid unexpected behaviors.
According to https://github.com/pluginaweek/state_machine/issues/279, this is because the state_machine
's default value and database's default value are different. In fact, the former is 0
(:created
), and the latter is 2
(:success
), today.
There was a reason why it ended up like so, however, after we have finished the add_column_with_default
migration, we can drop the default value on status
column. Ideally, this value should be initialized by the state machine.
What are the relevant issue numbers?
Close https://gitlab.com/gitlab-org/gitlab-ce/issues/53702
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - [-] Documentation created/updated
- [-] Tests added for this feature/bug
-
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides - [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.