Correct default values differences between production and structure.sql
In #211781, a number of schema inconsistencies were identified between the GitLab.com production database and the structure.sql
file.
One such problem is different default values for the same column or a default value defined only in only one of the environments.
A summary can be found in the following (internal only) spreadsheet
Updating the default of a column comes at almost no cost (other than acquiring the lock for altering the table) as it doesn't affect any existing rows in the table, it just changes the default for future INSERT commands.
In most cases that should cover us, but if we also have to fix existing values (e.g. changing the default to false
for a Boolean column should be most probably accompanied in most cases by switching NULLs to false). In this rare case, a data migration may be also required.
/cc @craig-gomes