3 ms·
I like that Prisma drops the database. Developer databases should be idempotent and easily reseedable with sample data. It's the same concept as cattle, not pet
by satvikpendem 3y ago
I like that Prisma drops the database. Developer databases should be idempotent and easily reseedable with sample data. It's the same concept as cattle, not pets, from the devops world but now applied to databases. There should be nothing special about a database in development that cannot be dropped and recreated.
- anonzzzies 3y agoI don’t care about dev databases; I care about why it does it; there is no need for it, at all. > I like that Prisma drops the database. ‘Like’ ; so if it didn’t but still worked perfectly, you would complain that it didn’t?
- satvikpendem 3y ago> ‘Like’ ; so if it didn’t but still worked perfectly, you would complain that it didn’t? Yep I would, because it maintains the idempotency invariant, plus it flushes out any bugs that may exist if databases are not idempotent from seed data, that is the "why it does it."
- kgeist 3y agoWe have a script which recreates the dev DB, but developers must run the command manually so that there was an understanding what's happening.
- satvikpendem 3y agoSure, but that requires the developer to do so manually whereas in an automated system, it should just be self-generating and self-cleaning.