@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
|
@@ -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.
|
|
9
|
-
|
|
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
|
|
16
|
-
clientCompany String?
|
|
17
|
-
clientCompanyModel ClientCompany?
|
|
18
|
-
company
|
|
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?
|
|
22
|
-
createdAt DateTime?
|
|
23
|
-
updatedAt DateTime?
|
|
24
|
-
deletedAt DateTime?
|
|
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
|
+
}
|