Create catalog_resource_versions table
What does this MR do and why?
This MR creates a new table, catalog_resource_versions
, as well as its model and associations. The purpose of this table is to contain the catalog resource versions
(equivalent to project releases
) that contain valid CI components.
The schema is the following:
catalog_resource_versions(
catalog_resource_id FK to catalog_resources.id
release_id FK to releases.id
project_id FK to projects.id
created_at
)
Note: Per the migration documentation (https://docs.gitlab.com/ee/development/migration_style_guide.html#creating-a-new-table-when-we-have-two-foreign-keys), the foreign keys were added as separate migrations.
Resolves #415286 (closed).
Migrations
Up
main: == [advisory_lock_connection] object_id: 223540, pg_backend_pid: 30534
main: == 20230626211305 CreateCatalogResourceVersions: migrating ====================
main: -- create_table(:catalog_resource_versions)
main: -> 0.0077s
main: == 20230626211305 CreateCatalogResourceVersions: migrated (0.1137s) ===========
main: == [advisory_lock_connection] object_id: 223540, pg_backend_pid: 30534
ci: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 30536
ci: == 20230626211305 CreateCatalogResourceVersions: migrating ====================
ci: -- create_table(:catalog_resource_versions)
ci: -> 0.0068s
I, [2023-06-26T18:19:26.273943 #30355] INFO -- : Database: 'ci', Table: 'catalog_resource_versions': Lock Writes
ci: == 20230626211305 CreateCatalogResourceVersions: migrated (0.0187s) ===========
ci: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 30536
main: == [advisory_lock_connection] object_id: 224080, pg_backend_pid: 30539
main: == 20230626215602 AddReleaseFkToCatalogResourceVersions: migrating ============
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_15376d917e FOREIGN KEY (release_id) REFERENCES releases (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0012s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_15376d917e;")
main: -> 0.0015s
main: -- execute("RESET statement_timeout")
main: -> 0.0004s
main: == 20230626215602 AddReleaseFkToCatalogResourceVersions: migrated (0.0401s) ===
main: == [advisory_lock_connection] object_id: 224080, pg_backend_pid: 30539
ci: == [advisory_lock_connection] object_id: 224280, pg_backend_pid: 30541
ci: == 20230626215602 AddReleaseFkToCatalogResourceVersions: migrating ============
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_15376d917e FOREIGN KEY (release_id) REFERENCES releases (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0011s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0004s
ci: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_15376d917e;")
ci: -> 0.0018s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20230626215602 AddReleaseFkToCatalogResourceVersions: migrated (0.0277s) ===
ci: == [advisory_lock_connection] object_id: 224280, pg_backend_pid: 30541
main: == [advisory_lock_connection] object_id: 224520, pg_backend_pid: 30544
main: == 20230626215614 AddProjectFkToCatalogResourceVersions: migrating ============
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_7ad8849db4 FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0021s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0006s
main: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_7ad8849db4;")
main: -> 0.0061s
main: -- execute("RESET statement_timeout")
main: -> 0.0007s
main: == 20230626215614 AddProjectFkToCatalogResourceVersions: migrated (0.0325s) ===
main: == [advisory_lock_connection] object_id: 224520, pg_backend_pid: 30544
ci: == [advisory_lock_connection] object_id: 224700, pg_backend_pid: 30546
ci: == 20230626215614 AddProjectFkToCatalogResourceVersions: migrating ============
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_7ad8849db4 FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0012s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0004s
ci: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_7ad8849db4;")
ci: -> 0.0051s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0004s
ci: == 20230626215614 AddProjectFkToCatalogResourceVersions: migrated (0.0323s) ===
ci: == [advisory_lock_connection] object_id: 224700, pg_backend_pid: 30546
main: == [advisory_lock_connection] object_id: 224960, pg_backend_pid: 30550
main: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: migrating ====
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_b670eae96b FOREIGN KEY (catalog_resource_id) REFERENCES catalog_resources (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0008s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_b670eae96b;")
main: -> 0.0022s
main: -- execute("RESET statement_timeout")
main: -> 0.0002s
main: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: migrated (0.0203s)
main: == [advisory_lock_connection] object_id: 224960, pg_backend_pid: 30550
ci: == [advisory_lock_connection] object_id: 226120, pg_backend_pid: 30552
ci: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: migrating ====
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE catalog_resource_versions ADD CONSTRAINT fk_b670eae96b FOREIGN KEY (catalog_resource_id) REFERENCES catalog_resources (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0007s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- execute("ALTER TABLE catalog_resource_versions VALIDATE CONSTRAINT fk_b670eae96b;")
ci: -> 0.0014s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: migrated (0.0223s)
ci: == [advisory_lock_connection] object_id: 226120, pg_backend_pid: 30552
Down
main: == [advisory_lock_connection] object_id: 223180, pg_backend_pid: 31220
main: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: reverting ====
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:catalog_resource_versions, {:column=>:catalog_resource_id})
main: -> 0.0950s
main: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: reverted (0.1096s)
main: == [advisory_lock_connection] object_id: 223180, pg_backend_pid: 31220
ci: == [advisory_lock_connection] object_id: 223200, pg_backend_pid: 31659
ci: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: reverting ====
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:catalog_resource_versions, {:column=>:catalog_resource_id})
ci: -> 0.1067s
ci: == 20230626215638 AddCatalogResourceFkToCatalogResourceVersions: reverted (0.1284s)
ci: == [advisory_lock_connection] object_id: 223200, pg_backend_pid: 31659
main: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 32097
main: == 20230626215614 AddProjectFkToCatalogResourceVersions: reverting ============
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:catalog_resource_versions, {:column=>:project_id})
main: -> 0.1116s
main: == 20230626215614 AddProjectFkToCatalogResourceVersions: reverted (0.1532s) ===
main: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 32097
ci: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 32530
ci: == 20230626215614 AddProjectFkToCatalogResourceVersions: reverting ============
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:catalog_resource_versions, {:column=>:project_id})
ci: -> 0.1070s
ci: == 20230626215614 AddProjectFkToCatalogResourceVersions: reverted (0.1308s) ===
ci: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 32530
main: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 32963
main: == 20230626215602 AddReleaseFkToCatalogResourceVersions: reverting ============
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:catalog_resource_versions, {:column=>:release_id})
main: -> 0.1055s
main: == 20230626215602 AddReleaseFkToCatalogResourceVersions: reverted (0.2128s) ===
main: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 32963
ci: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 33402
ci: == 20230626215602 AddReleaseFkToCatalogResourceVersions: reverting ============
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:catalog_resource_versions, {:column=>:release_id})
ci: -> 0.1099s
ci: == 20230626215602 AddReleaseFkToCatalogResourceVersions: reverted (0.1634s) ===
ci: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 33402
main: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 33842
main: == 20230626211305 CreateCatalogResourceVersions: reverting ====================
main: -- drop_table(:catalog_resource_versions)
main: -> 0.0022s
main: == 20230626211305 CreateCatalogResourceVersions: reverted (0.0071s) ===========
main: == [advisory_lock_connection] object_id: 223120, pg_backend_pid: 33842
ci: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 34277
ci: == 20230626211305 CreateCatalogResourceVersions: reverting ====================
ci: -- drop_table(:catalog_resource_versions)
ci: -> 0.0019s
ci: == 20230626211305 CreateCatalogResourceVersions: reverted (0.0119s) ===========
ci: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 34277
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #415286 (closed)
Merge request reports
Activity
changed milestone to %16.2
assigned to @lma-git
- A deleted user
added database databasereview pending documentation labels
1 Message This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
-
db/docs/catalog_resource_versions.yml
(Link to current live version)
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Aman Luthra (
@aluthra2
) (UTC+5.5, 12.5 hours ahead of@lma-git
)Niko Belokolodov (
@nbelokolodov
) (UTC+8, 15 hours ahead of@lma-git
)database Jarka Košanová (
@jarka
) (UTC+2, 9 hours ahead of@lma-git
)Leonardo da Rosa (
@l.rosa
) (UTC-3, 4 hours ahead of@lma-git
)~"migration" No reviewer available No maintainer available ~"Verify" Reviewer review is optional for ~"Verify" Stan Hu (
@stanhu
) (UTC-7, same timezone as@lma-git
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by Ghost User-
- A deleted user
added Data WarehouseImpact Check label
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
removed Data WarehouseImpact Check database databasereview pending documentation labels
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 3a2e5b34expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Manage | 12 | 0 | 1 | 12 | 13 | ❗ | | Plan | 47 | 0 | 0 | 41 | 47 | ❗ | | Data Stores | 20 | 0 | 0 | 15 | 20 | ❗ | | Create | 19 | 0 | 0 | 18 | 19 | ❗ | | Govern | 19 | 0 | 0 | 18 | 19 | ❗ | | Verify | 8 | 0 | 0 | 8 | 8 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 125 | 0 | 1 | 112 | 126 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+
Edited by Ghost User- A deleted user
added database databasereview pending documentation labels
- A deleted user
added Data WarehouseImpact Check label
- Resolved by Leaminn Ma