Skip to content

bug: inconsistent type definition for db meta field #475

@taterhead247

Description

@taterhead247

Describe the bug

A lot of our database tables have a filed of type json called meta. It's relatively free form. But, there should be some regulation to ensure it doesn't become an unruly mess.

https://github.com/F3-Nation/f3-nation/blob/dev/packages/shared/src/app/types.ts is a start at regulating it. But it's inconsistent.

  1. Not all tables have fields fully typed. EventMeta, LocationMeta and others have a few fields described (like eventTypeId). Others like UserMeta are completely empty.
  2. Case is not standard. In the above file, everything is camelCase. But there are a number of untyped field actively used in the database that are snake case. We should standardize.

Here's an example of user.meta from the db.

{
"my_f3_why": "To be able to keep up with my kids. ",
"brought_by": 24414,
"f3_name_origin": "At my first workout I was wearing a hoody from my high school rugby team. They asked me if i played. I said “I did, until I realized I don’t like tackling or being tackled.”",
"start_date_override": "2021-10-12",
"onboarding_completed": true,
"user_emergency_info_dr_sharing": true
}

Additional information

This standardization would apply to all ###Meta Types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions