Create ci_job_artifact_states' parent table and attach initial partition table

What does this MR do and why?

Creates ci_job_artifact_states' parent table and attach initial partition table. This is step 6 to partition ci_job_artifact_states .

References

#525415

Screenshots or screen recordings

                 Partitioned table "public.p_ci_job_artifact_states"
          Column          |           Type           | Collation | Nullable | Default
--------------------------+--------------------------+-----------+----------+---------
 verification_started_at  | timestamp with time zone |           |          |
 verification_retry_at    | timestamp with time zone |           |          |
 verified_at              | timestamp with time zone |           |          |
 job_artifact_id          | bigint                   |           | not null |
 verification_state       | smallint                 |           | not null | 0
 verification_retry_count | smallint                 |           |          |
 verification_checksum    | bytea                    |           |          |
 verification_failure     | text                     |           |          |
 partition_id             | bigint                   |           | not null |
 project_id               | bigint                   |           |          |
Partition key: LIST (partition_id)
Indexes:
    "p_ci_job_artifact_states_pkey" PRIMARY KEY, btree (job_artifact_id, partition_id)
    "p_ci_job_artifact_states_verification_retry_at_idx" btree (verification_retry_at NULLS FIRST) WHERE verification_state = 3
    "p_ci_job_artifact_states_verification_state_idx" btree (verification_state) WHERE verification_state = 0 OR verification_state = 3
    "p_ci_job_artifact_states_verification_state_idx1" btree (verification_state)
    "p_ci_job_artifact_states_verification_state_job_artifact_id_idx" btree (verification_state, job_artifact_id, partition_id)
    "p_ci_job_artifact_states_verified_at_idx" btree (verified_at NULLS FIRST) WHERE verification_state = 0
Check constraints:
    "check_df832b66ea" CHECK (char_length(verification_failure) <= 255)
Foreign-key constraints:
    "fk_rails_80a9cba3b2_p" FOREIGN KEY (partition_id, job_artifact_id) REFERENCES p_ci_job_artifacts(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE
Number of partitions: 1 (Use \d+ to list them.)

How to set up and validate locally

Migrations need to run successfully.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #525452

Edited by Natanael Silva

Merge request reports

Loading
Loading