mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 05:26:24 +09:00
add note about imports to template
This commit is contained in:
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) => {
|
||||
|
||||
Reference in new issue
Block a user