Remove all advisor stuff and fix migrations #25

Merged
tmyracle merged 1 commits from remove-advisor into main 2024-01-11 22:29:26 +08:00
tmyracle commented 2024-01-11 14:03:10 +08:00 (Migrated from github.com)

Addresses #21

  • Removes all advisor functionality
  • Removed relevant models and enums from database:
    • Advisor
    • Conversation
    • ConversationAdvisor
    • ConversationNote
    • MessageType
    • Message
    • ConversationStatus
    • ata fields from notifications on User

The notifications preferences UI will likely need an update (or total removal) later since the only thing left after removing the advisor notifications is a ConverKit function or 2. Will revisit once we get auth sorted and can log in and really test the UI.

I also tried to clean up some unused imports throughout files I touched, hence some of the deletions there.

This change also uses introspection to populate the dbgenerated parameters for columns that are a custom type (non native data type). There's a known issue in Prisma where dbgenerated() with nothing passed in will continue to generate migrations that are not compatible when it should noop. This should fix the migration hiccups discussed in the Discord.

I don't love having those big database functions in the schema.prisma file but seems to be the best workaround to get migrations working smoothly again. Might revisit later and refactor using triggers.

I also bumped prisma dependency to see if they had patched the issue, but no luck.

Lots of stuff going on here to remove all the advisor functionality so apologies for the massive PR.

Addresses #21 - Removes all advisor functionality - Removed relevant models and enums from database: - Advisor - Conversation - ConversationAdvisor - ConversationNote - MessageType - Message - ConversationStatus - ata fields from notifications on User The notifications preferences UI will likely need an update (or total removal) later since the only thing left after removing the advisor notifications is a ConverKit function or 2. Will revisit once we get auth sorted and can log in and really test the UI. I also tried to clean up some unused imports throughout files I touched, hence some of the deletions there. This change also uses introspection to populate the dbgenerated parameters for columns that are a custom type (non native data type). There's a [known issue](https://github.com/prisma/prisma/issues/15654) in Prisma where dbgenerated() with nothing passed in will continue to generate migrations that are not compatible when it should noop. This should fix the migration hiccups discussed in the Discord. I don't love having those big database functions in the schema.prisma file but seems to be the best workaround to get migrations working smoothly again. Might revisit later and refactor using triggers. I also bumped prisma dependency to see if they had patched the issue, but no luck. Lots of stuff going on here to remove all the advisor functionality so apologies for the massive PR.
Shpigford commented 2024-01-11 22:30:19 +08:00 (Migrated from github.com)

Thanks @tmyracle! Definitely would prefer smaller PRs in the future, but fine at the moment given we're doing some major cleanup and trying to reduce the overall complexity of the app.

Have merged to main.

Thanks @tmyracle! Definitely would prefer smaller PRs in the future, but fine at the moment given we're doing some major cleanup and trying to reduce the overall complexity of the app. Have merged to main.
Sign in to join this conversation.