MathSoc / mathsoc-website

A 2022-24 redevelopment of the University of Waterloo Math Society's website.
11 stars 3 forks source link

Sample migration #254

Closed some-molasses closed 3 months ago

some-molasses commented 4 months ago

Hello! This is a data migration. We're going to be using these going forwards to maintain the live data in each copy of the codebase.

In this PR, we update the schema of Contact Us to use image instead of img - this will help the page editor on the backend select more user-friendly editor nodes to display to the admin.

There are four parts: 1) Apply the changes we want to the data-base file 2) Update the page schema in schemas.ts 3) Update the actual usages of this attribute. In this case, and probably most cases, that just meant updating the .pug file. 4) Creating the migration. We define the

After that, if you re-run npm run dev, you should see your migration take effect! The relevant /data file (in this case, /data/contact-us.json) will have been updated, and hopefully, your page will work as you've envisioned.

Happy migrating!