add note about imports to template

This commit is contained in:
Roman Pominov committed 2022-09-09 15:03:39 +03:00
1 parent 254181eb9c
commit eed991b7fe
1 file changed
+13
@@ -1,5 +1,18 @@
import { PrismaClient } from "./client";
// NOTE ON IMPORTS:
//
// You shouldn't import any code that can change as the project evolves!
//
// It should be safe to import a library like `uuid` as its API is unlikely to change.
// For application code, it's better to copy it to the migration directory.
//
// If you have to import something that may change,
// be prepared to keep the migration code up to date as well.
//
// This is necessary because we want to be able to run old migrations at any point.
// For example, when we setting up a fresh database or making a reset.
export default () => {
const client = new PrismaClient();
return client.$transaction(async (prisma) => {