@allbluecn/database 0.9.5 → 0.10.0
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/generated/internal/class.ts +3 -3
- package/generated/internal/prismaNamespace.ts +1 -0
- package/generated/internal/prismaNamespaceBrowser.ts +1 -0
- package/generated/models/LegalRegulation.ts +36 -1
- package/generated-sqlite/internal/class.ts +3 -3
- package/generated-sqlite/internal/prismaNamespace.ts +1 -0
- package/generated-sqlite/internal/prismaNamespaceBrowser.ts +1 -0
- package/generated-sqlite/models/LegalRegulation.ts +36 -1
- package/migrations/20261028130000_legal_regulation_code/migration.sql +9 -0
- package/package.json +2 -2
- package/schema.prisma +1 -0
- package/schema.sqlite.prisma +1 -0
|
@@ -38,6 +38,7 @@ export type LegalRegulationMinAggregateOutputType = {
|
|
|
38
38
|
id: string | null
|
|
39
39
|
canonicalId: string | null
|
|
40
40
|
title: string | null
|
|
41
|
+
code: string | null
|
|
41
42
|
jurisdiction: string | null
|
|
42
43
|
region: string | null
|
|
43
44
|
country: string | null
|
|
@@ -59,6 +60,7 @@ export type LegalRegulationMaxAggregateOutputType = {
|
|
|
59
60
|
id: string | null
|
|
60
61
|
canonicalId: string | null
|
|
61
62
|
title: string | null
|
|
63
|
+
code: string | null
|
|
62
64
|
jurisdiction: string | null
|
|
63
65
|
region: string | null
|
|
64
66
|
country: string | null
|
|
@@ -80,6 +82,7 @@ export type LegalRegulationCountAggregateOutputType = {
|
|
|
80
82
|
id: number
|
|
81
83
|
canonicalId: number
|
|
82
84
|
title: number
|
|
85
|
+
code: number
|
|
83
86
|
jurisdiction: number
|
|
84
87
|
region: number
|
|
85
88
|
country: number
|
|
@@ -112,6 +115,7 @@ export type LegalRegulationMinAggregateInputType = {
|
|
|
112
115
|
id?: true
|
|
113
116
|
canonicalId?: true
|
|
114
117
|
title?: true
|
|
118
|
+
code?: true
|
|
115
119
|
jurisdiction?: true
|
|
116
120
|
region?: true
|
|
117
121
|
country?: true
|
|
@@ -133,6 +137,7 @@ export type LegalRegulationMaxAggregateInputType = {
|
|
|
133
137
|
id?: true
|
|
134
138
|
canonicalId?: true
|
|
135
139
|
title?: true
|
|
140
|
+
code?: true
|
|
136
141
|
jurisdiction?: true
|
|
137
142
|
region?: true
|
|
138
143
|
country?: true
|
|
@@ -154,6 +159,7 @@ export type LegalRegulationCountAggregateInputType = {
|
|
|
154
159
|
id?: true
|
|
155
160
|
canonicalId?: true
|
|
156
161
|
title?: true
|
|
162
|
+
code?: true
|
|
157
163
|
jurisdiction?: true
|
|
158
164
|
region?: true
|
|
159
165
|
country?: true
|
|
@@ -263,6 +269,7 @@ export type LegalRegulationGroupByOutputType = {
|
|
|
263
269
|
id: string
|
|
264
270
|
canonicalId: string
|
|
265
271
|
title: string
|
|
272
|
+
code: string | null
|
|
266
273
|
jurisdiction: string
|
|
267
274
|
region: string | null
|
|
268
275
|
country: string | null
|
|
@@ -308,6 +315,7 @@ export type LegalRegulationWhereInput = {
|
|
|
308
315
|
id?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
309
316
|
canonicalId?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
310
317
|
title?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
318
|
+
code?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
311
319
|
jurisdiction?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
312
320
|
region?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
313
321
|
country?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
@@ -331,6 +339,7 @@ export type LegalRegulationOrderByWithRelationInput = {
|
|
|
331
339
|
id?: Prisma.SortOrder
|
|
332
340
|
canonicalId?: Prisma.SortOrder
|
|
333
341
|
title?: Prisma.SortOrder
|
|
342
|
+
code?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
334
343
|
jurisdiction?: Prisma.SortOrder
|
|
335
344
|
region?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
336
345
|
country?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
@@ -357,6 +366,7 @@ export type LegalRegulationWhereUniqueInput = Prisma.AtLeast<{
|
|
|
357
366
|
NOT?: Prisma.LegalRegulationWhereInput | Prisma.LegalRegulationWhereInput[]
|
|
358
367
|
canonicalId?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
359
368
|
title?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
369
|
+
code?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
360
370
|
jurisdiction?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
361
371
|
region?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
362
372
|
country?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
@@ -380,6 +390,7 @@ export type LegalRegulationOrderByWithAggregationInput = {
|
|
|
380
390
|
id?: Prisma.SortOrder
|
|
381
391
|
canonicalId?: Prisma.SortOrder
|
|
382
392
|
title?: Prisma.SortOrder
|
|
393
|
+
code?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
383
394
|
jurisdiction?: Prisma.SortOrder
|
|
384
395
|
region?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
385
396
|
country?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
@@ -410,6 +421,7 @@ export type LegalRegulationScalarWhereWithAggregatesInput = {
|
|
|
410
421
|
id?: Prisma.StringWithAggregatesFilter<"LegalRegulation"> | string
|
|
411
422
|
canonicalId?: Prisma.StringWithAggregatesFilter<"LegalRegulation"> | string
|
|
412
423
|
title?: Prisma.StringWithAggregatesFilter<"LegalRegulation"> | string
|
|
424
|
+
code?: Prisma.StringNullableWithAggregatesFilter<"LegalRegulation"> | string | null
|
|
413
425
|
jurisdiction?: Prisma.StringWithAggregatesFilter<"LegalRegulation"> | string
|
|
414
426
|
region?: Prisma.StringNullableWithAggregatesFilter<"LegalRegulation"> | string | null
|
|
415
427
|
country?: Prisma.StringNullableWithAggregatesFilter<"LegalRegulation"> | string | null
|
|
@@ -432,6 +444,7 @@ export type LegalRegulationCreateInput = {
|
|
|
432
444
|
id?: string
|
|
433
445
|
canonicalId: string
|
|
434
446
|
title: string
|
|
447
|
+
code?: string | null
|
|
435
448
|
jurisdiction: string
|
|
436
449
|
region?: string | null
|
|
437
450
|
country?: string | null
|
|
@@ -454,6 +467,7 @@ export type LegalRegulationUncheckedCreateInput = {
|
|
|
454
467
|
id?: string
|
|
455
468
|
canonicalId: string
|
|
456
469
|
title: string
|
|
470
|
+
code?: string | null
|
|
457
471
|
jurisdiction: string
|
|
458
472
|
region?: string | null
|
|
459
473
|
country?: string | null
|
|
@@ -476,6 +490,7 @@ export type LegalRegulationUpdateInput = {
|
|
|
476
490
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
477
491
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
478
492
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
493
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
479
494
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
480
495
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
481
496
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -498,6 +513,7 @@ export type LegalRegulationUncheckedUpdateInput = {
|
|
|
498
513
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
499
514
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
500
515
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
516
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
501
517
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
502
518
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
503
519
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -520,6 +536,7 @@ export type LegalRegulationCreateManyInput = {
|
|
|
520
536
|
id?: string
|
|
521
537
|
canonicalId: string
|
|
522
538
|
title: string
|
|
539
|
+
code?: string | null
|
|
523
540
|
jurisdiction: string
|
|
524
541
|
region?: string | null
|
|
525
542
|
country?: string | null
|
|
@@ -542,6 +559,7 @@ export type LegalRegulationUpdateManyMutationInput = {
|
|
|
542
559
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
543
560
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
544
561
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
562
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
545
563
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
546
564
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
547
565
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -563,6 +581,7 @@ export type LegalRegulationUncheckedUpdateManyInput = {
|
|
|
563
581
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
564
582
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
565
583
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
584
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
566
585
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
567
586
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
568
587
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -595,6 +614,7 @@ export type LegalRegulationCountOrderByAggregateInput = {
|
|
|
595
614
|
id?: Prisma.SortOrder
|
|
596
615
|
canonicalId?: Prisma.SortOrder
|
|
597
616
|
title?: Prisma.SortOrder
|
|
617
|
+
code?: Prisma.SortOrder
|
|
598
618
|
jurisdiction?: Prisma.SortOrder
|
|
599
619
|
region?: Prisma.SortOrder
|
|
600
620
|
country?: Prisma.SortOrder
|
|
@@ -621,6 +641,7 @@ export type LegalRegulationMaxOrderByAggregateInput = {
|
|
|
621
641
|
id?: Prisma.SortOrder
|
|
622
642
|
canonicalId?: Prisma.SortOrder
|
|
623
643
|
title?: Prisma.SortOrder
|
|
644
|
+
code?: Prisma.SortOrder
|
|
624
645
|
jurisdiction?: Prisma.SortOrder
|
|
625
646
|
region?: Prisma.SortOrder
|
|
626
647
|
country?: Prisma.SortOrder
|
|
@@ -642,6 +663,7 @@ export type LegalRegulationMinOrderByAggregateInput = {
|
|
|
642
663
|
id?: Prisma.SortOrder
|
|
643
664
|
canonicalId?: Prisma.SortOrder
|
|
644
665
|
title?: Prisma.SortOrder
|
|
666
|
+
code?: Prisma.SortOrder
|
|
645
667
|
jurisdiction?: Prisma.SortOrder
|
|
646
668
|
region?: Prisma.SortOrder
|
|
647
669
|
country?: Prisma.SortOrder
|
|
@@ -709,6 +731,7 @@ export type LegalRegulationCreateWithoutUserInput = {
|
|
|
709
731
|
id?: string
|
|
710
732
|
canonicalId: string
|
|
711
733
|
title: string
|
|
734
|
+
code?: string | null
|
|
712
735
|
jurisdiction: string
|
|
713
736
|
region?: string | null
|
|
714
737
|
country?: string | null
|
|
@@ -730,6 +753,7 @@ export type LegalRegulationUncheckedCreateWithoutUserInput = {
|
|
|
730
753
|
id?: string
|
|
731
754
|
canonicalId: string
|
|
732
755
|
title: string
|
|
756
|
+
code?: string | null
|
|
733
757
|
jurisdiction: string
|
|
734
758
|
region?: string | null
|
|
735
759
|
country?: string | null
|
|
@@ -779,6 +803,7 @@ export type LegalRegulationScalarWhereInput = {
|
|
|
779
803
|
id?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
780
804
|
canonicalId?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
781
805
|
title?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
806
|
+
code?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
782
807
|
jurisdiction?: Prisma.StringFilter<"LegalRegulation"> | string
|
|
783
808
|
region?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
784
809
|
country?: Prisma.StringNullableFilter<"LegalRegulation"> | string | null
|
|
@@ -801,6 +826,7 @@ export type LegalRegulationCreateManyUserInput = {
|
|
|
801
826
|
id?: string
|
|
802
827
|
canonicalId: string
|
|
803
828
|
title: string
|
|
829
|
+
code?: string | null
|
|
804
830
|
jurisdiction: string
|
|
805
831
|
region?: string | null
|
|
806
832
|
country?: string | null
|
|
@@ -822,6 +848,7 @@ export type LegalRegulationUpdateWithoutUserInput = {
|
|
|
822
848
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
823
849
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
824
850
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
851
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
825
852
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
826
853
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
827
854
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -843,6 +870,7 @@ export type LegalRegulationUncheckedUpdateWithoutUserInput = {
|
|
|
843
870
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
844
871
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
845
872
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
873
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
846
874
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
847
875
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
848
876
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -864,6 +892,7 @@ export type LegalRegulationUncheckedUpdateManyWithoutUserInput = {
|
|
|
864
892
|
id?: Prisma.StringFieldUpdateOperationsInput | string
|
|
865
893
|
canonicalId?: Prisma.StringFieldUpdateOperationsInput | string
|
|
866
894
|
title?: Prisma.StringFieldUpdateOperationsInput | string
|
|
895
|
+
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
867
896
|
jurisdiction?: Prisma.StringFieldUpdateOperationsInput | string
|
|
868
897
|
region?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
869
898
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
@@ -887,6 +916,7 @@ export type LegalRegulationSelect<ExtArgs extends runtime.Types.Extensions.Inter
|
|
|
887
916
|
id?: boolean
|
|
888
917
|
canonicalId?: boolean
|
|
889
918
|
title?: boolean
|
|
919
|
+
code?: boolean
|
|
890
920
|
jurisdiction?: boolean
|
|
891
921
|
region?: boolean
|
|
892
922
|
country?: boolean
|
|
@@ -910,6 +940,7 @@ export type LegalRegulationSelectCreateManyAndReturn<ExtArgs extends runtime.Typ
|
|
|
910
940
|
id?: boolean
|
|
911
941
|
canonicalId?: boolean
|
|
912
942
|
title?: boolean
|
|
943
|
+
code?: boolean
|
|
913
944
|
jurisdiction?: boolean
|
|
914
945
|
region?: boolean
|
|
915
946
|
country?: boolean
|
|
@@ -933,6 +964,7 @@ export type LegalRegulationSelectUpdateManyAndReturn<ExtArgs extends runtime.Typ
|
|
|
933
964
|
id?: boolean
|
|
934
965
|
canonicalId?: boolean
|
|
935
966
|
title?: boolean
|
|
967
|
+
code?: boolean
|
|
936
968
|
jurisdiction?: boolean
|
|
937
969
|
region?: boolean
|
|
938
970
|
country?: boolean
|
|
@@ -956,6 +988,7 @@ export type LegalRegulationSelectScalar = {
|
|
|
956
988
|
id?: boolean
|
|
957
989
|
canonicalId?: boolean
|
|
958
990
|
title?: boolean
|
|
991
|
+
code?: boolean
|
|
959
992
|
jurisdiction?: boolean
|
|
960
993
|
region?: boolean
|
|
961
994
|
country?: boolean
|
|
@@ -974,7 +1007,7 @@ export type LegalRegulationSelectScalar = {
|
|
|
974
1007
|
updatedAt?: boolean
|
|
975
1008
|
}
|
|
976
1009
|
|
|
977
|
-
export type LegalRegulationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "canonicalId" | "title" | "jurisdiction" | "region" | "country" | "category" | "issuingAuthority" | "effectiveDate" | "summary" | "content" | "sourceUrl" | "likeCount" | "tags" | "visibility" | "userId" | "isDeleted" | "createdAt" | "updatedAt", ExtArgs["result"]["legalRegulation"]>
|
|
1010
|
+
export type LegalRegulationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "canonicalId" | "title" | "code" | "jurisdiction" | "region" | "country" | "category" | "issuingAuthority" | "effectiveDate" | "summary" | "content" | "sourceUrl" | "likeCount" | "tags" | "visibility" | "userId" | "isDeleted" | "createdAt" | "updatedAt", ExtArgs["result"]["legalRegulation"]>
|
|
978
1011
|
export type LegalRegulationInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
979
1012
|
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
|
|
980
1013
|
}
|
|
@@ -994,6 +1027,7 @@ export type $LegalRegulationPayload<ExtArgs extends runtime.Types.Extensions.Int
|
|
|
994
1027
|
id: string
|
|
995
1028
|
canonicalId: string
|
|
996
1029
|
title: string
|
|
1030
|
+
code: string | null
|
|
997
1031
|
jurisdiction: string
|
|
998
1032
|
region: string | null
|
|
999
1033
|
country: string | null
|
|
@@ -1437,6 +1471,7 @@ export interface LegalRegulationFieldRefs {
|
|
|
1437
1471
|
readonly id: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1438
1472
|
readonly canonicalId: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1439
1473
|
readonly title: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1474
|
+
readonly code: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1440
1475
|
readonly jurisdiction: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1441
1476
|
readonly region: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
1442
1477
|
readonly country: Prisma.FieldRef<"LegalRegulation", 'String'>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- 审计 S7:LegalRegulation.code 持久化列,根治 canonicalId「改标题后漂移」。
|
|
2
|
+
-- 历史上 code 仅参与 canonicalId 计算(code||title,code 优先)不落库,
|
|
3
|
+
-- update 仅改 title 时 canonicalId 从 code 维度回落 title 维度,分享/收藏
|
|
4
|
+
-- 关联(entityId=canonicalId)静默失联。落列后 update 以 existing.code 回退。
|
|
5
|
+
ALTER TABLE "legal_regulations" ADD COLUMN "code" TEXT;
|
|
6
|
+
|
|
7
|
+
-- 存量回填:canonicalId 当年按「code 优先」计算,canonicalId <> title 的行
|
|
8
|
+
-- 其 canonicalId 即创建/最近一次显式更新时的 code。
|
|
9
|
+
UPDATE "legal_regulations" SET "code" = "canonicalId" WHERE "canonicalId" <> "title";
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allbluecn/database",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
7
7
|
"types": "./index.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@allbluecn/kernel": "0.10.
|
|
9
|
+
"@allbluecn/kernel": "0.10.2",
|
|
10
10
|
"@prisma/adapter-better-sqlite3": "^7.9.0",
|
|
11
11
|
"@prisma/adapter-pg": "7.8.0",
|
|
12
12
|
"@prisma/client": "7.8.0",
|
package/schema.prisma
CHANGED