Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix datastore types #195

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Fix datastore types #195

merged 3 commits into from
Jun 14, 2024

Conversation

johnpooch
Copy link
Collaborator

@zond apologies. It appears appengine prefers primitive type. Maybe there's another way, but this seems to work.

@zond
Copy link
Owner

zond commented Jun 13, 2024

It should work fine with nested structs as well, but you can't let it be a pointer in the datastore structure.

ChatLanguageISO639_1 string `methods:"POST,PUT"`
GameMasterEnabled bool `methods:"POST"`
RequireGameMasterInvitation bool `methods:"POST,PUT"`
DiscordWebhooks *DiscordWebhooks `methods:"POST" datastore:",noindex"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing the * should make it work I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Tested locally and it worked. thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wait, doesn't that mean that it's a required field? I don't want to break existing create game ux

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go will just default it to the empty value, which in this case will be two empty strings. And datastore works the same way, so nothing will break :D

All old games will just have empty values in those fields.

@johnpooch johnpooch merged commit 0808d8a into master Jun 14, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants