-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
update for crossposting to territories #800
base: master
Are you sure you want to change the base?
update for crossposting to territories #800
Conversation
…igration file with trigger on _ItemSub join table to update Item table, and updated create_item and update_item to update _ItemSub table on create and update of an item
keeping prisma schema up to date
Cool! I'm going to put this in draft until it's the whole hog. One thing I've noticed off the jump: if you're going to add a table, we'd prefer it be defined in prisma.schema if it can be. Also, unless there's a convention I'm unaware of "_ItemSub" should probably just be "ItemSub." |
Got it. Sounds good. The underscore style (_Name) is what prisma creates automatically when a many-to-many relationship is defined in the schema. It's an implicit pass-through table creation, which I don't personally like. I'll update that. |
This is the pull request for crossposting to territories. I am starting with the criteria from @huumn in #712 . This is just the changes for the schema so far. I left the old sub field, and added a new
subs
field. I figured this would be better for migration. This migration will update the new table and ‘subs’ field in Item. Then once the rest of the code is pointed toward using the subs and subNames, sub will be unused and ready for cleanup whenever it’s safely in production. That sound like a good path? I’ll update this branch with the rest of the changes as I go.Here is a quick glance of what I have so far:
update prisma schema
on Item
on Sub
+ Items Item[] @relation("ItemSub")
updated migration file with trigger on new _ItemSub join table to update Item table
updated create_item and update_item to update _ItemSub table on create and update of an item
create_item
update_item
Update new database fields and tables with existing data