Ghost icon indicating copy to clipboard operation
Ghost copied to clipboard

`members.uuid` is marked as `nullable` in database schema

Open nikwen opened this issue 1 year ago • 2 comments

Issue Summary

https://github.com/TryGhost/Ghost/pull/11341 introduced UUIDs for members.

It introduced a migration to backfill UUIDs for existing members, and introduced defaults so that each new member would have a UUID.

It seems to me like the database schema should be adjusted to mark the members.uuid column as nullable: false.

When https://github.com/TryGhost/Ghost/pull/14600 introduced UUIDs for newsletters, it included a migration to drop nullable from the new newsletters.uuid column. A similar migration could probably be created for the members table.

Steps to Reproduce

  1. Look at the schema here: https://github.com/TryGhost/Ghost/blob/048f17757ce7f08f0e7ab7135d1ac5b59b395db8/ghost/core/core/server/data/schema/schema.js#L428

Ghost Version

5.108.1

Node.js Version

20.18.1

How did you install Ghost?

Irrelevant for the issue

Database type

MySQL 5.7

Browser & OS version

No response

Relevant log / error output


Code of Conduct

  • [x] I agree to be friendly and polite to people in this repository

nikwen avatar Jan 29 '25 21:01 nikwen

Great find, and very valid! Thank you for opening the issue 🙌

sagzy avatar Jan 30 '25 06:01 sagzy

can i solve the issue , i will raise the pr immediately !!

PriyaDharsini2006 avatar May 03 '25 16:05 PriyaDharsini2006