vona-module-a-orm 5.0.66 → 5.0.68
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.js +7 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3713,7 +3713,7 @@ function config(_app) {
|
|
|
3713
3713
|
}
|
|
3714
3714
|
},
|
|
3715
3715
|
table: {
|
|
3716
|
-
identityType: '
|
|
3716
|
+
identityType: 'bigint'
|
|
3717
3717
|
},
|
|
3718
3718
|
model: {
|
|
3719
3719
|
disableDeleted: false,
|
|
@@ -3788,10 +3788,12 @@ function ExtendTableBuilder(app) {
|
|
|
3788
3788
|
options = options || {};
|
|
3789
3789
|
if (options.id !== false) {
|
|
3790
3790
|
const _identityType = identityType ?? scope.config.table.identityType;
|
|
3791
|
-
if (_identityType === '
|
|
3791
|
+
if (_identityType === 'bigint') {
|
|
3792
3792
|
this.bigIncrements();
|
|
3793
3793
|
} else if (_identityType === 'number') {
|
|
3794
3794
|
this.increments();
|
|
3795
|
+
} else {
|
|
3796
|
+
throw new Error('Should create column id by yourself');
|
|
3795
3797
|
}
|
|
3796
3798
|
}
|
|
3797
3799
|
if (options.timestamps !== false) this.timestamps(true, true, true);
|
|
@@ -3809,10 +3811,12 @@ function ExtendTableBuilder(app) {
|
|
|
3809
3811
|
});
|
|
3810
3812
|
knex.TableBuilder.extend('tableIdentity', function (columnName) {
|
|
3811
3813
|
const _identityType = scope.config.table.identityType;
|
|
3812
|
-
if (_identityType === '
|
|
3814
|
+
if (_identityType === 'bigint') {
|
|
3813
3815
|
return this.bigInteger(columnName); // default value is null
|
|
3814
3816
|
} else if (_identityType === 'number') {
|
|
3815
3817
|
return this.integer(columnName); // default value is null
|
|
3818
|
+
} else {
|
|
3819
|
+
throw new Error(`Should create column ${columnName} by yourself`);
|
|
3816
3820
|
}
|
|
3817
3821
|
});
|
|
3818
3822
|
knex.TableBuilder.extend('userId', function (columnName) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-orm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.68",
|
|
5
5
|
"title": "a-orm",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"capabilities": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"knex": "^3.1.0",
|
|
62
|
-
"table-identity": "^1.0.
|
|
62
|
+
"table-identity": "^1.0.12"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"clean-package": "^2.2.0",
|