Clean up schema for table deployments
From https://gitlab.com/gitlab-com/infrastructure/issues/1709 (private to GitLab employees):
-
Wrong data type: created_at should be timestamptz -
Wrong data type: updated_at should be timestamptz -
Wrong data type: sha should be bytea -
Missing constraint: created_at NOT NULL -
Missing constraint: updated_at NOT NULL -
Missing constraint: deployable_id NOT NULL -
Missing constraint: deployable_type NOT NULL -
Missing FK: project_id -> projects -
Missing FK: environment_id -> environments (1132 entries violate this rule) -
Missing FK: user_id -> users (1683 entries violate this rule) -
Duplicate data: ref, deployable_type
Edited by Yorick Peterse