@campus-labs/prisma-client 0.13.0 → 0.14.1
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/.claude/settings.local.json +11 -0
- package/package.json +1 -1
- package/prisma/schema.prisma +23 -2
- package/prisma/seed-tags.ts +64 -0
- package/tsconfig.json +5 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(ls -la /Users/nunomatos/Desktop/SerMais/prisma/.env*)",
|
|
5
|
+
"Bash(git check-ignore -v /Users/nunomatos/Desktop/SerMais/prisma/.env.staging)",
|
|
6
|
+
"Bash(git check-ignore -v .env.staging)",
|
|
7
|
+
"Bash(ls -la /Users/nunomatos/Desktop/SerMais/prisma/*.ts /Users/nunomatos/Desktop/SerMais/prisma/*.js)",
|
|
8
|
+
"Bash(grep -r \"\\\\.password\" /Users/nunomatos/Desktop/SerMais --include=\"*.ts\" --include=\"*.js\" ! -path \"*/node_modules/*\" ! -path \"*/.next/*\" ! -path \"*/dist/*\")"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -625,17 +625,19 @@ model projects {
|
|
|
625
625
|
is_pending Boolean @default(false)
|
|
626
626
|
is_published Boolean @default(false)
|
|
627
627
|
author_id String @db.VarChar(50)
|
|
628
|
-
gamification_designer_id String
|
|
628
|
+
gamification_designer_id String @db.VarChar(50)
|
|
629
629
|
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
630
630
|
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
631
631
|
deleted_at DateTime? @db.Timestamp(6)
|
|
632
|
+
version Int @default(1)
|
|
633
|
+
current_state Json
|
|
632
634
|
snapshots snapshots[]
|
|
633
635
|
initiatives initiatives[]
|
|
636
|
+
patches patches[]
|
|
634
637
|
|
|
635
638
|
users users @relation("ProjectAuthor", fields: [author_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
636
639
|
gamification_designer users @relation("ProjectGamificationDesigner", fields: [gamification_designer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
637
640
|
|
|
638
|
-
|
|
639
641
|
@@index([author_id], map: "idx_projects_author")
|
|
640
642
|
@@index([gamification_designer_id], map: "idx_projects_designer")
|
|
641
643
|
}
|
|
@@ -645,9 +647,11 @@ model snapshots {
|
|
|
645
647
|
project_id Int
|
|
646
648
|
data Json
|
|
647
649
|
accepted Boolean @default(false)
|
|
650
|
+
version Int @default(1)
|
|
648
651
|
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
649
652
|
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
650
653
|
deleted_at DateTime? @db.Timestamp(6)
|
|
654
|
+
state Json
|
|
651
655
|
|
|
652
656
|
projects projects @relation(fields: [project_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
653
657
|
|
|
@@ -679,4 +683,21 @@ model initiatives_tags {
|
|
|
679
683
|
@@id([initiative_id, tag_id])
|
|
680
684
|
@@index([initiative_id], map: "idx_initiatives_tags_initiative")
|
|
681
685
|
@@index([tag_id], map: "idx_initiatives_tags_tag")
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
model patches {
|
|
689
|
+
id Int @id @default(autoincrement())
|
|
690
|
+
project_id Int
|
|
691
|
+
operations Int[]
|
|
692
|
+
is_ai_generated Boolean
|
|
693
|
+
is_adopted String @default("PENDING") @db.VarChar(20)
|
|
694
|
+
version Int @default(1)
|
|
695
|
+
type String @db.VarChar(20)
|
|
696
|
+
created_at DateTime @default(now()) @db.Timestamp(6)
|
|
697
|
+
updated_at DateTime @default(now()) @db.Timestamp(6)
|
|
698
|
+
deleted_at DateTime? @db.Timestamp(6)
|
|
699
|
+
|
|
700
|
+
projects projects @relation(fields: [project_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
701
|
+
|
|
702
|
+
@@index([project_id], map: "idx_patches_project")
|
|
682
703
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PrismaClient } from '@prisma/client';
|
|
2
|
+
|
|
3
|
+
const prisma = new PrismaClient();
|
|
4
|
+
|
|
5
|
+
const tags = [
|
|
6
|
+
'Gaming',
|
|
7
|
+
'Música',
|
|
8
|
+
'Cinema',
|
|
9
|
+
'Fotografia',
|
|
10
|
+
'Teatro',
|
|
11
|
+
'Networking',
|
|
12
|
+
'Artes Visuais',
|
|
13
|
+
'Literatura',
|
|
14
|
+
'Património',
|
|
15
|
+
'História',
|
|
16
|
+
'Informática',
|
|
17
|
+
'Eletrónica',
|
|
18
|
+
'Robótica',
|
|
19
|
+
'Inteligência Artificial',
|
|
20
|
+
'Astronomia',
|
|
21
|
+
'Cultura Maker (DIY)',
|
|
22
|
+
'Debates',
|
|
23
|
+
'Conferências',
|
|
24
|
+
'Desporto',
|
|
25
|
+
'Atividades Náuticas',
|
|
26
|
+
'Natureza',
|
|
27
|
+
'Saúde',
|
|
28
|
+
'Jogos de Tabuleiro',
|
|
29
|
+
'Viagens',
|
|
30
|
+
'Erasmus',
|
|
31
|
+
'Nutrição',
|
|
32
|
+
'Sustentabilidade',
|
|
33
|
+
'Voluntariado',
|
|
34
|
+
'Política',
|
|
35
|
+
'Empreendedorismo',
|
|
36
|
+
'Finanças',
|
|
37
|
+
'Ciência',
|
|
38
|
+
'Investigação',
|
|
39
|
+
'Convívios',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
async function main() {
|
|
43
|
+
console.log('🌱 A popular tags...');
|
|
44
|
+
|
|
45
|
+
for (const tag of tags) {
|
|
46
|
+
await prisma.tags.upsert({
|
|
47
|
+
where: { tag },
|
|
48
|
+
update: {},
|
|
49
|
+
create: { tag },
|
|
50
|
+
});
|
|
51
|
+
console.log(` ✅ ${tag}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log(`\n🎉 ${tags.length} tags processadas com sucesso!`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
main()
|
|
58
|
+
.catch((e) => {
|
|
59
|
+
console.error('❌ Erro ao popular tags:', e);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
})
|
|
62
|
+
.finally(async () => {
|
|
63
|
+
await prisma.$disconnect();
|
|
64
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
3
|
+
"module": "Node16",
|
|
4
4
|
"target": "ES2019",
|
|
5
|
-
"moduleResolution": "
|
|
5
|
+
"moduleResolution": "node16",
|
|
6
|
+
"rootDir": "./prisma",
|
|
6
7
|
"esModuleInterop": true,
|
|
7
|
-
"outDir": "dist"
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
"types": ["node"]
|
|
8
10
|
},
|
|
9
11
|
"include": ["prisma/**/*"]
|
|
10
12
|
}
|