Add cached markdown fields for ML Model Version

What does this MR do and why?

This MR adds the cached markdown fields to the Ml::ModelVersion so it can later be used with markdown descriptions.

Migration up

bin/rails db:migrate:up:main VERSION=20240812092309
main: == [advisory_lock_connection] object_id: 127060, pg_backend_pid: 53428
main: == 20240812092309 AddCachedMarkdownToMlModelVersion: migrating ================
main: -- change_table(:ml_model_versions)
main:    -> 0.0016s
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- execute("ALTER TABLE ml_model_versions\nADD CONSTRAINT check_4d50116294\nCHECK ( char_length(description_html) <= 50000 )\nNOT VALID;\n")
main:    -> 0.0008s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0001s
main: -- execute("ALTER TABLE ml_model_versions VALIDATE CONSTRAINT check_4d50116294;")
main:    -> 0.0003s
main: -- execute("RESET statement_timeout")
main:    -> 0.0001s
main: == 20240812092309 AddCachedMarkdownToMlModelVersion: migrated (0.0267s) =======

main: == [advisory_lock_connection] object_id: 127060, pg_backend_pid: 53428

Migration down

bin/rails db:migrate:down:main VERSION=20240812092309
main: == [advisory_lock_connection] object_id: 127060, pg_backend_pid: 52738
main: == 20240812092309 AddCachedMarkdownToMlModelVersion: reverting ================
main: -- remove_columns(:ml_model_versions, :cached_markdown_version, :description_html)
main:    -> 0.0011s
main: == 20240812092309 AddCachedMarkdownToMlModelVersion: reverted (0.0038s) =======

main: == [advisory_lock_connection] object_id: 127060, pg_backend_pid: 52738```

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #478475 (closed)

Edited by Fred de Gier

Merge request reports

Loading