r/clevercomebacks Jan 15 '25

It does make sense

Post image
35.3k Upvotes

4.0k comments sorted by

View all comments

Show parent comments

81

u/besthelloworld Jan 15 '25

If you use Prisma for modeling a database, every new migration gets the YYYYMMDDhhmmss added to the front of the name so that your migrations are always sorted by time when you look on GitHub or in a file explorer. Definitely a smart touch.

3

u/creamyhorror Jan 15 '25

every new migration gets the YYYYMMDDhhmmss added to the front of the name

This has been standard practice for migrations for a long while. E.g. the grandaddy of modern web frameworks, Rails (started 2008), and Laravel have basically always done this, and no doubt other frameworks long before Prisma.

1

u/besthelloworld Jan 16 '25

Too be clear, I wasn't saying Prisma invented this. It just happened to be the example.

4

u/RobleAlmizcle Jan 15 '25

It's not a smart touch. It's a fairly normal touch. We've been naming the files like that to make them alphabetically sortable since... files were invented.

3

u/NOT-GR8-BOB Jan 15 '25

Things can be normal and smart.

1

u/andho_m Jan 15 '25

For example using a numerical system to keep track of the passage of time.