add a noop migration

This commit is contained in:
Roman Pominov committed 2022-09-05 15:36:29 +03:00
1 parent 7ec8e351fd
commit 63cd5e2df0
2 files changed
+94

No files matched your search

@@ -0,0 +1,11 @@
import { PrismaClient } from "./client";
export default () => {
const client = new PrismaClient();
return client.$transaction(async (prisma) => {
const usersCount = await prisma.user.count();
// eslint-disable-next-line no-console
console.log("Example noop migration test", { usersCount });
});
};
@@ -0,0 +1,83 @@
// DO NOT EDIT THIS FILE!
// This a copy of your schema.prisma that corresponds to the state of the database
// when all migrations up until this one are applied.
// It's used to generate a Prisma Client for the migration.
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
output = "client"
}
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
}
model Team {
id String @id @default(uuid())
users User[]
}
enum Location {
FS
REMOTE
}
model Asset {
id String @id @default(uuid())
project Project @relation(fields: [projectId], references: [id])
projectId String
format String?
size Int
width Decimal?
height Decimal?
name String
alt String?
location Location
createdAt DateTime @default(now())
}
model User {
id String @id @default(uuid())
email String? @unique
provider String?
image String?
username String?
createdAt DateTime @default(now())
team Team? @relation(fields: [teamId], references: [id])
teamId String?
projects Project[]
}
model Project {
id String @id @default(uuid())
title String
domain String @unique
prodTreeId String? // exists when published
devTreeId String
prodTreeIdHistory String @default("[]")
user User? @relation(fields: [userId], references: [id])
userId String?
assets Asset[]
}
model Tree {
id String @id @default(uuid())
root String
}
model InstanceProps {
id String @id @default(uuid())
instanceId String
treeId String
props String @default("[]")
}
model Breakpoints {
treeId String @id @default(uuid())
values String @default("[]")
}