@casekit/orm2-fixtures 1.0.1 → 1.0.3

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/build/index.d.ts CHANGED
@@ -518,6 +518,86 @@ export declare const config: {
518
518
  };
519
519
  };
520
520
  };
521
+ department: {
522
+ readonly fields: {
523
+ readonly id: {
524
+ readonly type: "serial";
525
+ readonly primaryKey: true;
526
+ };
527
+ readonly name: {
528
+ readonly type: "text";
529
+ };
530
+ };
531
+ readonly relations: {
532
+ readonly employees: {
533
+ readonly type: "1:N";
534
+ readonly model: "employee";
535
+ readonly fromField: "id";
536
+ readonly toField: "departmentId";
537
+ };
538
+ };
539
+ };
540
+ employee: {
541
+ readonly fields: {
542
+ readonly id: {
543
+ readonly type: "serial";
544
+ readonly primaryKey: true;
545
+ };
546
+ readonly name: {
547
+ readonly type: "text";
548
+ };
549
+ readonly departmentId: {
550
+ readonly type: "integer";
551
+ readonly references: {
552
+ readonly model: "department";
553
+ readonly field: "id";
554
+ };
555
+ };
556
+ };
557
+ readonly relations: {
558
+ readonly department: {
559
+ readonly type: "N:1";
560
+ readonly model: "department";
561
+ readonly fromField: "departmentId";
562
+ readonly toField: "id";
563
+ };
564
+ readonly tasks: {
565
+ readonly type: "1:N";
566
+ readonly model: "task";
567
+ readonly fromField: "id";
568
+ readonly toField: "assigneeId";
569
+ };
570
+ };
571
+ };
572
+ task: {
573
+ readonly fields: {
574
+ readonly id: {
575
+ readonly type: "serial";
576
+ readonly primaryKey: true;
577
+ };
578
+ readonly title: {
579
+ readonly type: "text";
580
+ };
581
+ readonly assigneeId: {
582
+ readonly type: "integer";
583
+ readonly nullable: true;
584
+ readonly references: {
585
+ readonly model: "employee";
586
+ readonly field: "id";
587
+ readonly onDelete: "SET NULL";
588
+ };
589
+ };
590
+ };
591
+ readonly relations: {
592
+ readonly assignee: {
593
+ readonly type: "N:1";
594
+ readonly model: "employee";
595
+ readonly fromField: "assigneeId";
596
+ readonly toField: "id";
597
+ readonly optional: true;
598
+ };
599
+ };
600
+ };
521
601
  };
522
602
  naming: {
523
603
  table: typeof snakeCase;
@@ -0,0 +1,19 @@
1
+ export declare const department: {
2
+ readonly fields: {
3
+ readonly id: {
4
+ readonly type: "serial";
5
+ readonly primaryKey: true;
6
+ };
7
+ readonly name: {
8
+ readonly type: "text";
9
+ };
10
+ };
11
+ readonly relations: {
12
+ readonly employees: {
13
+ readonly type: "1:N";
14
+ readonly model: "employee";
15
+ readonly fromField: "id";
16
+ readonly toField: "departmentId";
17
+ };
18
+ };
19
+ };
@@ -0,0 +1,14 @@
1
+ export const department = {
2
+ fields: {
3
+ id: { type: "serial", primaryKey: true },
4
+ name: { type: "text" },
5
+ },
6
+ relations: {
7
+ employees: {
8
+ type: "1:N",
9
+ model: "employee",
10
+ fromField: "id",
11
+ toField: "departmentId",
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,32 @@
1
+ export declare const employee: {
2
+ readonly fields: {
3
+ readonly id: {
4
+ readonly type: "serial";
5
+ readonly primaryKey: true;
6
+ };
7
+ readonly name: {
8
+ readonly type: "text";
9
+ };
10
+ readonly departmentId: {
11
+ readonly type: "integer";
12
+ readonly references: {
13
+ readonly model: "department";
14
+ readonly field: "id";
15
+ };
16
+ };
17
+ };
18
+ readonly relations: {
19
+ readonly department: {
20
+ readonly type: "N:1";
21
+ readonly model: "department";
22
+ readonly fromField: "departmentId";
23
+ readonly toField: "id";
24
+ };
25
+ readonly tasks: {
26
+ readonly type: "1:N";
27
+ readonly model: "task";
28
+ readonly fromField: "id";
29
+ readonly toField: "assigneeId";
30
+ };
31
+ };
32
+ };
@@ -0,0 +1,27 @@
1
+ export const employee = {
2
+ fields: {
3
+ id: { type: "serial", primaryKey: true },
4
+ name: { type: "text" },
5
+ departmentId: {
6
+ type: "integer",
7
+ references: {
8
+ model: "department",
9
+ field: "id",
10
+ },
11
+ },
12
+ },
13
+ relations: {
14
+ department: {
15
+ type: "N:1",
16
+ model: "department",
17
+ fromField: "departmentId",
18
+ toField: "id",
19
+ },
20
+ tasks: {
21
+ type: "1:N",
22
+ model: "task",
23
+ fromField: "id",
24
+ toField: "assigneeId",
25
+ },
26
+ },
27
+ };
@@ -509,4 +509,84 @@ export declare const models: {
509
509
  };
510
510
  };
511
511
  };
512
+ department: {
513
+ readonly fields: {
514
+ readonly id: {
515
+ readonly type: "serial";
516
+ readonly primaryKey: true;
517
+ };
518
+ readonly name: {
519
+ readonly type: "text";
520
+ };
521
+ };
522
+ readonly relations: {
523
+ readonly employees: {
524
+ readonly type: "1:N";
525
+ readonly model: "employee";
526
+ readonly fromField: "id";
527
+ readonly toField: "departmentId";
528
+ };
529
+ };
530
+ };
531
+ employee: {
532
+ readonly fields: {
533
+ readonly id: {
534
+ readonly type: "serial";
535
+ readonly primaryKey: true;
536
+ };
537
+ readonly name: {
538
+ readonly type: "text";
539
+ };
540
+ readonly departmentId: {
541
+ readonly type: "integer";
542
+ readonly references: {
543
+ readonly model: "department";
544
+ readonly field: "id";
545
+ };
546
+ };
547
+ };
548
+ readonly relations: {
549
+ readonly department: {
550
+ readonly type: "N:1";
551
+ readonly model: "department";
552
+ readonly fromField: "departmentId";
553
+ readonly toField: "id";
554
+ };
555
+ readonly tasks: {
556
+ readonly type: "1:N";
557
+ readonly model: "task";
558
+ readonly fromField: "id";
559
+ readonly toField: "assigneeId";
560
+ };
561
+ };
562
+ };
563
+ task: {
564
+ readonly fields: {
565
+ readonly id: {
566
+ readonly type: "serial";
567
+ readonly primaryKey: true;
568
+ };
569
+ readonly title: {
570
+ readonly type: "text";
571
+ };
572
+ readonly assigneeId: {
573
+ readonly type: "integer";
574
+ readonly nullable: true;
575
+ readonly references: {
576
+ readonly model: "employee";
577
+ readonly field: "id";
578
+ readonly onDelete: "SET NULL";
579
+ };
580
+ };
581
+ };
582
+ readonly relations: {
583
+ readonly assignee: {
584
+ readonly type: "N:1";
585
+ readonly model: "employee";
586
+ readonly fromField: "assigneeId";
587
+ readonly toField: "id";
588
+ readonly optional: true;
589
+ };
590
+ };
591
+ };
512
592
  };
@@ -1,11 +1,14 @@
1
1
  import { audit } from "./audit.js";
2
2
  import { color } from "./color.js";
3
3
  import { counter } from "./counter.js";
4
+ import { department } from "./department.js";
5
+ import { employee } from "./employee.js";
4
6
  import { friendship } from "./friendship.js";
5
7
  import { friendshipStats } from "./friendshipStats.js";
6
8
  import { kitchenSink } from "./kitchenSink.js";
7
9
  import { like } from "./like.js";
8
10
  import { post } from "./post.js";
11
+ import { task } from "./task.js";
9
12
  import { user } from "./user.js";
10
13
  export const models = {
11
14
  audit,
@@ -17,4 +20,7 @@ export const models = {
17
20
  friendship,
18
21
  friendshipStats,
19
22
  kitchenSink,
23
+ department,
24
+ employee,
25
+ task,
20
26
  };
@@ -0,0 +1,29 @@
1
+ export declare const task: {
2
+ readonly fields: {
3
+ readonly id: {
4
+ readonly type: "serial";
5
+ readonly primaryKey: true;
6
+ };
7
+ readonly title: {
8
+ readonly type: "text";
9
+ };
10
+ readonly assigneeId: {
11
+ readonly type: "integer";
12
+ readonly nullable: true;
13
+ readonly references: {
14
+ readonly model: "employee";
15
+ readonly field: "id";
16
+ readonly onDelete: "SET NULL";
17
+ };
18
+ };
19
+ };
20
+ readonly relations: {
21
+ readonly assignee: {
22
+ readonly type: "N:1";
23
+ readonly model: "employee";
24
+ readonly fromField: "assigneeId";
25
+ readonly toField: "id";
26
+ readonly optional: true;
27
+ };
28
+ };
29
+ };
@@ -0,0 +1,24 @@
1
+ export const task = {
2
+ fields: {
3
+ id: { type: "serial", primaryKey: true },
4
+ title: { type: "text" },
5
+ assigneeId: {
6
+ type: "integer",
7
+ nullable: true,
8
+ references: {
9
+ model: "employee",
10
+ field: "id",
11
+ onDelete: "SET NULL",
12
+ },
13
+ },
14
+ },
15
+ relations: {
16
+ assignee: {
17
+ type: "N:1",
18
+ model: "employee",
19
+ fromField: "assigneeId",
20
+ toField: "id",
21
+ optional: true,
22
+ },
23
+ },
24
+ };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@casekit/orm2-fixtures",
3
3
  "description": "",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "es-toolkit": "^1.39.3",
8
- "@casekit/orm2-config": "1.0.1",
9
- "@casekit/orm2-schema": "1.0.1",
10
- "@casekit/sql": "1.0.1"
8
+ "@casekit/orm2-schema": "1.0.3",
9
+ "@casekit/orm2-config": "1.0.3",
10
+ "@casekit/sql": "1.0.3"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
@@ -19,8 +19,8 @@
19
19
  "typescript": "^5.8.3",
20
20
  "typescript-eslint": "^8.34.1",
21
21
  "vite-tsconfig-paths": "^5.1.4",
22
- "@casekit/prettier-config": "1.0.1",
23
- "@casekit/tsconfig": "1.0.1"
22
+ "@casekit/tsconfig": "1.0.3",
23
+ "@casekit/prettier-config": "1.0.3"
24
24
  },
25
25
  "exports": {
26
26
  ".": "./build/index.js"