Hacker News

Tell HN: Prisma Is Great Now

Hacker News - Thu, 03/27/2025 - 1:14pm

So just now I had to make a migration to add a new table between two other tables that previously were joined with each other in a fairly early stage app I'm building.

I already had data in the tables and another dev working on it now, so I didn't want to nuke the database. So I got prisma to make the first migration (which it autogenerates from the new prisma schema file).

It warned me that it couldn't "just do this", because the existing data would be left with empty foreign keys, but that I could do the "just make the migration" step and not run it yet.

So I did that, opened the migration file. I changed the FK column to have a default of 0 where it was added. Then I got chatGPT to make me a SQL data migration to create default entries in the new table for each org (we're multi-tenant), then link the other table to the new default. Which was almost a stored proc in its own right.

Then I took a deep breath and told prisma to run the migration.

Pleasantly surprising: the schema+data migration ran successfully...

Extra nice bonus:

Prisma automatically made another new migration to cleanup the FK column by removing the DEFAULT! (The kind of thing you usually need to remember to do after a migration like this, but could be forgiven for forgetting)

I mean, it's just doing its usual thing really, keeping the db schema in sync with the prisma schema, but the whole thing was pretty pleasant DX for what can be a nerve wracking thing to do.

It's a really solid and mature library, as ORM's go I can really recommend it.

Comments URL: https://news.ycombinator.com/item?id=43495701

Points: 2

# Comments: 0

Categories: Hacker News

Reclaiming Our Attention

Hacker News - Thu, 03/27/2025 - 12:23pm
Categories: Hacker News

Show HN: I'm helping founders rank #1 on ChatGPT, Perplexity, Grok and other LLM

Hacker News - Thu, 03/27/2025 - 12:19pm

Hey guys, I’m the founder of AuthenticPosts .com and ValidatedSaaS .com

Over the past few months, I’ve been digging into how LLMs rank websites. Now, I’m on a mission to help 500+ founders and creators improve their AI search rankings by the end of 2025.

If your site isn’t showing up in AI-driven search and you want to fix that, I’m happy to take the time to help with your specific site.

Comments URL: https://news.ycombinator.com/item?id=43495169

Points: 1

# Comments: 0

Categories: Hacker News

High Voltage... Possibly

Hacker News - Thu, 03/27/2025 - 12:11pm
Categories: Hacker News

Pages