diff --git a/apps/designer/package.json b/apps/designer/package.json index c7ffe52ce0..615618ed94 100644 --- a/apps/designer/package.json +++ b/apps/designer/package.json @@ -14,7 +14,8 @@ "prettier": "prettier \"*.{js,md,json,ts}\" \"{docs,app}/**/*.{js,md,json,ts}\"", "storybook:run": "start-storybook -p 6006", "storybook:build": "build-storybook", - "migrations": "migrations --dev" + "migrations": "migrations --dev", + "migrations:deploy": "migrations migrate" }, "dependencies": { "@lexical/react": "^0.3.5", diff --git a/packages/prisma-client/prisma/migrations/20220905153337_noop/migration.ts b/packages/prisma-client/prisma/migrations/20220905153337_noop/migration.ts new file mode 100644 index 0000000000..6d8fead3b5 --- /dev/null +++ b/packages/prisma-client/prisma/migrations/20220905153337_noop/migration.ts @@ -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 }); + }); +}; diff --git a/packages/prisma-client/prisma/migrations/20220905153337_noop/schema.prisma b/packages/prisma-client/prisma/migrations/20220905153337_noop/schema.prisma new file mode 100644 index 0000000000..05761a9e1f --- /dev/null +++ b/packages/prisma-client/prisma/migrations/20220905153337_noop/schema.prisma @@ -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("[]") +}