Project model should require organization
Eventually the Project object should be instantiated with an explicit Organization and we should not default to the default organization. The issue is to add a requirement that Project
only save when organization
has been defined.
Related to Namespace model should require organization (#411832)
Implementation steps
- Set project organization from its namespace in code
✅ - Remove default 1 for
organization_id
on the projects table.✅ - Monitor the
organization_id
column if it's being set to null through some code path. - If it's being set to null then we need to find and fix that code path.
- Perform a backfill.
- Monitor the
organization_id
column again. If no nulls are found add the validation and then add the not null constraint.
Edited by Bojan Marjanovic