@famgia/omnify-types 2.0.2 → 2.0.4
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/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/package.json +1 -1
- package/schemas/omnify-schema.json +17 -0
package/dist/index.d.cts
CHANGED
|
@@ -1392,6 +1392,15 @@ interface SchemaOptions {
|
|
|
1392
1392
|
* @default 'BigInt'
|
|
1393
1393
|
*/
|
|
1394
1394
|
readonly idType?: IdType;
|
|
1395
|
+
/**
|
|
1396
|
+
* Custom primary key column(s).
|
|
1397
|
+
* - String: Single column as primary key
|
|
1398
|
+
* - Array: Composite primary key (for pivot tables)
|
|
1399
|
+
* When set, automatically implies id: false (no auto-generated ID column).
|
|
1400
|
+
* @example primaryKey: 'code'
|
|
1401
|
+
* @example primaryKey: ['role_id', 'permission_id']
|
|
1402
|
+
*/
|
|
1403
|
+
readonly primaryKey?: string | readonly string[];
|
|
1395
1404
|
/** Add created_at and updated_at timestamp columns */
|
|
1396
1405
|
readonly timestamps?: boolean;
|
|
1397
1406
|
/** Add deleted_at column for soft deletes */
|
package/dist/index.d.ts
CHANGED
|
@@ -1392,6 +1392,15 @@ interface SchemaOptions {
|
|
|
1392
1392
|
* @default 'BigInt'
|
|
1393
1393
|
*/
|
|
1394
1394
|
readonly idType?: IdType;
|
|
1395
|
+
/**
|
|
1396
|
+
* Custom primary key column(s).
|
|
1397
|
+
* - String: Single column as primary key
|
|
1398
|
+
* - Array: Composite primary key (for pivot tables)
|
|
1399
|
+
* When set, automatically implies id: false (no auto-generated ID column).
|
|
1400
|
+
* @example primaryKey: 'code'
|
|
1401
|
+
* @example primaryKey: ['role_id', 'permission_id']
|
|
1402
|
+
*/
|
|
1403
|
+
readonly primaryKey?: string | readonly string[];
|
|
1395
1404
|
/** Add created_at and updated_at timestamp columns */
|
|
1396
1405
|
readonly timestamps?: boolean;
|
|
1397
1406
|
/** Add deleted_at column for soft deletes */
|
package/package.json
CHANGED
|
@@ -95,6 +95,23 @@
|
|
|
95
95
|
"default": "BigInt",
|
|
96
96
|
"description": "Type of the auto-generated 'id' column"
|
|
97
97
|
},
|
|
98
|
+
"primaryKey": {
|
|
99
|
+
"oneOf": [
|
|
100
|
+
{
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Single column as primary key"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"minItems": 1,
|
|
110
|
+
"description": "Composite primary key (multiple columns)"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"description": "Custom primary key column(s). When set, automatically implies id: false (no auto-generated ID column)"
|
|
114
|
+
},
|
|
98
115
|
"timestamps": {
|
|
99
116
|
"type": "boolean",
|
|
100
117
|
"default": true,
|