@ocap/indexdb-sqlite 1.29.23 → 1.29.24
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/esm/db/index.mjs +8 -0
- package/esm/migrations/005-rollup-missing-columns.d.mts +7 -0
- package/esm/migrations/005-rollup-missing-columns.mjs +63 -0
- package/esm/migrations/index.mjs +3 -1
- package/esm/package.mjs +1 -1
- package/lib/db/index.cjs +8 -0
- package/lib/migrations/005-rollup-missing-columns.cjs +70 -0
- package/lib/migrations/005-rollup-missing-columns.d.cts +7 -0
- package/lib/migrations/index.cjs +3 -1
- package/lib/package.cjs +1 -1
- package/package.json +7 -7
package/esm/db/index.mjs
CHANGED
|
@@ -382,6 +382,14 @@ var SqliteIndexDB = class extends base_default$1 {
|
|
|
382
382
|
"minWithdrawAmount",
|
|
383
383
|
"totalDepositAmount",
|
|
384
384
|
"totalWithdrawAmount",
|
|
385
|
+
"minDepositFee",
|
|
386
|
+
"maxDepositFee",
|
|
387
|
+
"minWithdrawFee",
|
|
388
|
+
"maxWithdrawFee",
|
|
389
|
+
"maxDepositAmount",
|
|
390
|
+
"maxWithdrawAmount",
|
|
391
|
+
"minBlockConfirmation",
|
|
392
|
+
"blockHeight",
|
|
385
393
|
"migrateHistory",
|
|
386
394
|
"vaultHistory",
|
|
387
395
|
"data",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/005-rollup-missing-columns.ts
|
|
5
|
+
var _005_rollup_missing_columns_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
const MISSING_COLUMNS = [
|
|
10
|
+
{
|
|
11
|
+
name: "minDepositFee",
|
|
12
|
+
type: "TEXT"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "maxDepositFee",
|
|
16
|
+
type: "TEXT"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "minWithdrawFee",
|
|
20
|
+
type: "TEXT"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "maxWithdrawFee",
|
|
24
|
+
type: "TEXT"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "maxDepositAmount",
|
|
28
|
+
type: "TEXT"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "maxWithdrawAmount",
|
|
32
|
+
type: "TEXT"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "minBlockConfirmation",
|
|
36
|
+
type: "INTEGER"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "blockHeight",
|
|
40
|
+
type: "INTEGER"
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
async function up(db) {
|
|
44
|
+
for (const col of MISSING_COLUMNS) await sql.raw(`ALTER TABLE rollup ADD COLUMN ${col.name} ${col.type}`).execute(db);
|
|
45
|
+
await sql.raw(`UPDATE rollup SET
|
|
46
|
+
minDepositFee = json_extract(data, '$.minDepositFee'),
|
|
47
|
+
maxDepositFee = json_extract(data, '$.maxDepositFee'),
|
|
48
|
+
minWithdrawFee = json_extract(data, '$.minWithdrawFee'),
|
|
49
|
+
maxWithdrawFee = json_extract(data, '$.maxWithdrawFee'),
|
|
50
|
+
maxDepositAmount = json_extract(data, '$.maxDepositAmount'),
|
|
51
|
+
maxWithdrawAmount = json_extract(data, '$.maxWithdrawAmount'),
|
|
52
|
+
minBlockConfirmation = json_extract(data, '$.minBlockConfirmation'),
|
|
53
|
+
blockHeight = json_extract(data, '$.blockHeight')
|
|
54
|
+
WHERE data IS NOT NULL AND data != '{}' AND json_valid(data)`).execute(db);
|
|
55
|
+
await sql.raw(`UPDATE rollup SET data = json_remove(data,
|
|
56
|
+
'$.minDepositFee', '$.maxDepositFee', '$.minWithdrawFee', '$.maxWithdrawFee',
|
|
57
|
+
'$.maxDepositAmount', '$.maxWithdrawAmount', '$.minBlockConfirmation', '$.blockHeight'
|
|
58
|
+
) WHERE data IS NOT NULL AND data != '{}' AND json_valid(data)`).execute(db);
|
|
59
|
+
}
|
|
60
|
+
async function down(_db) {}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { _005_rollup_missing_columns_exports, down, up };
|
package/esm/migrations/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { _001_genesis_exports } from "./001-genesis.mjs";
|
|
|
2
2
|
import { _002_composite_indexes_exports } from "./002-composite-indexes.mjs";
|
|
3
3
|
import { _003_delegation_extensions_exports } from "./003-delegation-extensions.mjs";
|
|
4
4
|
import { _004_search_indexes_exports } from "./004-search-indexes.mjs";
|
|
5
|
+
import { _005_rollup_missing_columns_exports } from "./005-rollup-missing-columns.mjs";
|
|
5
6
|
import { Migrator } from "kysely";
|
|
6
7
|
|
|
7
8
|
//#region src/migrations/index.ts
|
|
@@ -15,7 +16,8 @@ var InMemoryMigrationProvider = class {
|
|
|
15
16
|
"001-genesis": _001_genesis_exports,
|
|
16
17
|
"002-composite-indexes": _002_composite_indexes_exports,
|
|
17
18
|
"003-delegation-extensions": _003_delegation_extensions_exports,
|
|
18
|
-
"004-search-indexes": _004_search_indexes_exports
|
|
19
|
+
"004-search-indexes": _004_search_indexes_exports,
|
|
20
|
+
"005-rollup-missing-columns": _005_rollup_missing_columns_exports
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
};
|
package/esm/package.mjs
CHANGED
package/lib/db/index.cjs
CHANGED
|
@@ -383,6 +383,14 @@ var SqliteIndexDB = class extends require_db_base.default {
|
|
|
383
383
|
"minWithdrawAmount",
|
|
384
384
|
"totalDepositAmount",
|
|
385
385
|
"totalWithdrawAmount",
|
|
386
|
+
"minDepositFee",
|
|
387
|
+
"maxDepositFee",
|
|
388
|
+
"minWithdrawFee",
|
|
389
|
+
"maxWithdrawFee",
|
|
390
|
+
"maxDepositAmount",
|
|
391
|
+
"maxWithdrawAmount",
|
|
392
|
+
"minBlockConfirmation",
|
|
393
|
+
"blockHeight",
|
|
386
394
|
"migrateHistory",
|
|
387
395
|
"vaultHistory",
|
|
388
396
|
"data",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let kysely = require("kysely");
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/005-rollup-missing-columns.ts
|
|
5
|
+
var _005_rollup_missing_columns_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
const MISSING_COLUMNS = [
|
|
10
|
+
{
|
|
11
|
+
name: "minDepositFee",
|
|
12
|
+
type: "TEXT"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "maxDepositFee",
|
|
16
|
+
type: "TEXT"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "minWithdrawFee",
|
|
20
|
+
type: "TEXT"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "maxWithdrawFee",
|
|
24
|
+
type: "TEXT"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "maxDepositAmount",
|
|
28
|
+
type: "TEXT"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "maxWithdrawAmount",
|
|
32
|
+
type: "TEXT"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "minBlockConfirmation",
|
|
36
|
+
type: "INTEGER"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "blockHeight",
|
|
40
|
+
type: "INTEGER"
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
async function up(db) {
|
|
44
|
+
for (const col of MISSING_COLUMNS) await kysely.sql.raw(`ALTER TABLE rollup ADD COLUMN ${col.name} ${col.type}`).execute(db);
|
|
45
|
+
await kysely.sql.raw(`UPDATE rollup SET
|
|
46
|
+
minDepositFee = json_extract(data, '$.minDepositFee'),
|
|
47
|
+
maxDepositFee = json_extract(data, '$.maxDepositFee'),
|
|
48
|
+
minWithdrawFee = json_extract(data, '$.minWithdrawFee'),
|
|
49
|
+
maxWithdrawFee = json_extract(data, '$.maxWithdrawFee'),
|
|
50
|
+
maxDepositAmount = json_extract(data, '$.maxDepositAmount'),
|
|
51
|
+
maxWithdrawAmount = json_extract(data, '$.maxWithdrawAmount'),
|
|
52
|
+
minBlockConfirmation = json_extract(data, '$.minBlockConfirmation'),
|
|
53
|
+
blockHeight = json_extract(data, '$.blockHeight')
|
|
54
|
+
WHERE data IS NOT NULL AND data != '{}' AND json_valid(data)`).execute(db);
|
|
55
|
+
await kysely.sql.raw(`UPDATE rollup SET data = json_remove(data,
|
|
56
|
+
'$.minDepositFee', '$.maxDepositFee', '$.minWithdrawFee', '$.maxWithdrawFee',
|
|
57
|
+
'$.maxDepositAmount', '$.maxWithdrawAmount', '$.minBlockConfirmation', '$.blockHeight'
|
|
58
|
+
) WHERE data IS NOT NULL AND data != '{}' AND json_valid(data)`).execute(db);
|
|
59
|
+
}
|
|
60
|
+
async function down(_db) {}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
Object.defineProperty(exports, '_005_rollup_missing_columns_exports', {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return _005_rollup_missing_columns_exports;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
exports.down = down;
|
|
70
|
+
exports.up = up;
|
package/lib/migrations/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ const require_migrations_001_genesis = require('./001-genesis.cjs');
|
|
|
3
3
|
const require_migrations_002_composite_indexes = require('./002-composite-indexes.cjs');
|
|
4
4
|
const require_migrations_003_delegation_extensions = require('./003-delegation-extensions.cjs');
|
|
5
5
|
const require_migrations_004_search_indexes = require('./004-search-indexes.cjs');
|
|
6
|
+
const require_migrations_005_rollup_missing_columns = require('./005-rollup-missing-columns.cjs');
|
|
6
7
|
let kysely = require("kysely");
|
|
7
8
|
|
|
8
9
|
//#region src/migrations/index.ts
|
|
@@ -16,7 +17,8 @@ var InMemoryMigrationProvider = class {
|
|
|
16
17
|
"001-genesis": require_migrations_001_genesis._001_genesis_exports,
|
|
17
18
|
"002-composite-indexes": require_migrations_002_composite_indexes._002_composite_indexes_exports,
|
|
18
19
|
"003-delegation-extensions": require_migrations_003_delegation_extensions._003_delegation_extensions_exports,
|
|
19
|
-
"004-search-indexes": require_migrations_004_search_indexes._004_search_indexes_exports
|
|
20
|
+
"004-search-indexes": require_migrations_004_search_indexes._004_search_indexes_exports,
|
|
21
|
+
"005-rollup-missing-columns": require_migrations_005_rollup_missing_columns._005_rollup_missing_columns_exports
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
};
|
package/lib/package.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-sqlite",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses SQLite as backend",
|
|
4
|
-
"version": "1.29.
|
|
4
|
+
"version": "1.29.24",
|
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ArcBlock/blockchain/issues",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ocap/indexdb-test": "1.29.
|
|
17
|
+
"@ocap/indexdb-test": "1.29.24"
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/indexdb/sqlite",
|
|
20
20
|
"keywords": [
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"clean": "rm -rf lib esm"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@arcblock/did": "1.29.
|
|
67
|
-
"@ocap/indexdb": "1.29.
|
|
68
|
-
"@ocap/types": "1.29.
|
|
69
|
-
"@ocap/util": "1.29.
|
|
66
|
+
"@arcblock/did": "1.29.24",
|
|
67
|
+
"@ocap/indexdb": "1.29.24",
|
|
68
|
+
"@ocap/types": "1.29.24",
|
|
69
|
+
"@ocap/util": "1.29.24",
|
|
70
70
|
"debug": "^4.4.3",
|
|
71
71
|
"better-sqlite3": "^11.8.1",
|
|
72
|
-
"kysely": "^0.
|
|
72
|
+
"kysely": "^0.28.14",
|
|
73
73
|
"kysely-bun-sqlite": "^0.4.0",
|
|
74
74
|
"lodash": "^4.17.23"
|
|
75
75
|
}
|