@a_team/prisma 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a_team/prisma",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "keywords": [],
5
5
  "scripts": {
6
6
  "generate": "npx prisma generate",
@@ -5,8 +5,15 @@ import { PrismaClient } from "@prisma/client";
5
5
  const prisma = new PrismaClient();
6
6
 
7
7
  async function main() {
8
- const missionSpec = await prisma.missionSpec.findMany({
9
- take: 5,
8
+ const missionSpec = await prisma.missionSpec.findUnique({
9
+ where: { id: "66b3856aa504b6860c86f3ac" },
10
+ select: {
11
+ account: {
12
+ select: {
13
+ company: true,
14
+ },
15
+ },
16
+ },
10
17
  });
11
18
  console.log(missionSpec);
12
19
  }
@@ -0,0 +1,21 @@
1
+ // npx ts-node playground/missionSpecs.ts
2
+
3
+ import { PrismaClient } from "@prisma/client";
4
+
5
+ const prisma = new PrismaClient();
6
+
7
+ async function main() {
8
+ const missionSpec = await prisma.missionSpec.findMany({
9
+ take: 5,
10
+ });
11
+ console.log(missionSpec);
12
+ }
13
+
14
+ main()
15
+ .then(async () => {
16
+ await prisma.$disconnect();
17
+ })
18
+ .catch(async (e) => {
19
+ console.error(e);
20
+ await prisma.$disconnect();
21
+ });
@@ -12,16 +12,17 @@ type AccountsWorkspace {
12
12
  }
13
13
 
14
14
  model Account {
15
- id String @id @default(auto()) @map("_id") @db.ObjectId
16
- clientCompany String? @db.ObjectId
17
- clientCompanyModel ClientCompany? @relation(fields: [clientCompany], references: [id])
18
- company EnrichableCompany[]
15
+ id String @id @default(auto()) @map("_id") @db.ObjectId
16
+ clientCompany String? @db.ObjectId
17
+ clientCompanyModel ClientCompany? @relation(fields: [clientCompany], references: [id])
18
+ companyId String @map("company") @db.ObjectId
19
+ company Company @relation(fields: [companyId], references: [id])
19
20
  members AccountsMember[]
20
21
  workspace AccountsWorkspace?
21
- billingAccount String? @db.ObjectId
22
- createdAt DateTime? @db.Date
23
- updatedAt DateTime? @db.Date
24
- deletedAt DateTime? @db.Date
22
+ billingAccount String? @db.ObjectId
23
+ createdAt DateTime? @db.Date
24
+ updatedAt DateTime? @db.Date
25
+ deletedAt DateTime? @db.Date
25
26
  migrations String[]
26
27
  missions Mission[]
27
28
  missionSpecs MissionSpec[]
@@ -0,0 +1,13 @@
1
+ model Company {
2
+ id String @id @default(auto()) @map("_id") @db.ObjectId
3
+ accounts Account[]
4
+ createdBy String? @db.ObjectId
5
+ createdAt DateTime? @db.Date
6
+ updatedAt DateTime? @db.Date
7
+ name String
8
+ url String
9
+
10
+ @@index([name, createdAt], map: "name_1_createdAt_-1")
11
+ @@index([url], map: "url_1")
12
+ @@map("companiesV2")
13
+ }
@@ -1,8 +0,0 @@
1
- model EnrichableCompany {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- name String
4
- accountId String? @db.ObjectId
5
- accountModel Account? @relation(fields: [accountId], references: [id])
6
-
7
- @@map("companiesV2")
8
- }