@danielcok17/prisma-db 1.20.18 → 1.20.19

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": "@danielcok17/prisma-db",
3
- "version": "1.20.18",
3
+ "version": "1.20.19",
4
4
  "description": "Shared Prisma schema for Legal AI applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,18 @@ CREATE INDEX "legal_opinion_case_number_decision_date_idx" ON "legal_opinion" ("
22
22
  CREATE INDEX "legal_opinion_source_idx" ON "legal_opinion" ("source");
23
23
 
24
24
  -- Backfill from existing legal_precedents rows that have a právna veta
25
- INSERT INTO "legal_opinion" ("case_number", "decision_date", "ecli", "source", "text", "reasoning")
26
- SELECT
27
- lp.case_number,
28
- lp.decision_date,
29
- lp.ecli,
30
- 'legal_precedents',
31
- lp.legal_opinion,
32
- lp.opinion_reasoning
33
- FROM legal_precedents lp
34
- WHERE lp.legal_opinion IS NOT NULL AND lp.legal_opinion != '';
25
+ DO $$
26
+ BEGIN
27
+ IF EXISTS (SELECT FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'legal_precedents') THEN
28
+ INSERT INTO "legal_opinion" ("case_number", "decision_date", "ecli", "source", "text", "reasoning")
29
+ SELECT
30
+ lp.case_number,
31
+ lp.decision_date,
32
+ lp.ecli,
33
+ 'legal_precedents',
34
+ lp.legal_opinion,
35
+ lp.opinion_reasoning
36
+ FROM legal_precedents lp
37
+ WHERE lp.legal_opinion IS NOT NULL AND lp.legal_opinion != '';
38
+ END IF;
39
+ END $$;