Home
Categories
EXPLORE
True Crime
Comedy
Society & Culture
Business
Sports
Technology
History
About Us
Contact Us
Copyright
© 2024 PodJoint
Podjoint Logo
US
00:00 / 00:00
Sign in

or

Don't have an account?
Sign up
Forgot password
https://is1-ssl.mzstatic.com/image/thumb/Podcasts125/v4/f3/de/0e/f3de0ec1-a1ff-ad7e-1d42-2ee41cae7253/mza_7142444209140500111.png/600x600bb.jpg
3 Minutes with Kent
Kent C. Dodds
235 episodes
8 months ago
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
RSS
All content for 3 Minutes with Kent is the property of Kent C. Dodds and is served directly from their servers with no modification, redirects, or rehosting. The podcast is not affiliated with or endorsed by Podjoint in any way.
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
https://briefs-production.s3.amazonaws.com/cover_art/34/Drawing__1_.png
Make your DB schema as restrictive as possible for easier migrations
3 Minutes with Kent
2 minutes 23 seconds
4 years ago
Make your DB schema as restrictive as possible for easier migrations
Hello there friends. Welcome to June I am thinking about Postgres and Prisma and that sort of thing a lot lately because I'm working on my website and doing that sort of thing and one tip that I have for you if you ever do database sort of things is try to make sorry to make your data as. As restrictive as possible. Early on as as you're trying to make things. So like make things if you're like, I don't know if there should be a required field or not make it required. If you're this is an enum but we could have this we could have a lot of different values for this potentially have the fewest number of values possible to get you to the next phase. The reason is because it's a lot easier to later do a migration.That expands the permissive venous of that schema than going the other direction because when you go the other direction, you have to find all of the data rows that don't go into the new schema and update those so that they they fit. So, for example, if you have a first name field and you decide to make it optional first and then after you have a bunch of users you come in later and you decide no no this first name field needs to.Be required. Well, now you have to first go and update all of the usernames to be like unknown or something before you can do that schema update. And so yeah, just try to when you're starting a new project or when you're yeah, I guess not even a new project but when you're adding a new model or something like that try to be as restrictive as possible early and then you can loosen things up later when you have more context and you know, what makes more sense. So yeah, hopefully that's helpful and interesting. IIt's this is just personally affected me because I I was really loose at the start of this project and then I had to tighten things up and it's kind of annoying. So anyway, I hope that's interesting helpful. Ah, but a nice day.
3 Minutes with Kent
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss