Skip to content

#30526 (A) [BE] Wiki Events (models)

Alex Kalderimis requested to merge 30526-a-be-wiki-activity-Models into master

What does this MR do?

This MR is the modelling sections of the work required for #30526 (closed)

This adds two new models (WikePageMeta and WikiPageSlug) which are used to record the metadata for wiki pages when we create events. These records are updated when slugs change (through our API) so that we maintain referential integrity, and can look up wiki pages even when their ID is now different.

Future work will require us maintaining these records for pages created through the git-access API

Migration Output

Console output for rollback:

$ rails db:rollback
== 20200302152516 AddWikiSlug: reverting ======================================
-- drop_table(:wiki_page_slugs, {:id=>:serial})
   -> 0.0816s
-- drop_table(:wiki_page_meta, {:id=>:serial})
   -> 0.0036s
== 20200302152516 AddWikiSlug: reverted (0.0912s) =============================

Console output for migrate:

$ rails db:migrate
== 20200302152516 AddWikiSlug: migrating ======================================
-- create_table(:wiki_page_meta, {:id=>:serial})
   -> 0.0701s
-- create_table(:wiki_page_slugs, {:id=>:serial})
   -> 0.0354s
== 20200302152516 AddWikiSlug: migrated (0.1058s) =============================

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

This just adds the new record types. No records are created in this MR (see the next in the series). This does not impose any new complexity on queries or change performance.

See #30526 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports