@spytecgps/nova-orm 1.4.221 → 1.4.222

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.
@@ -0,0 +1,16 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ /**
3
+ * FULLTEXT (ngram) indexes to back jarvis-web's cross-entity quick-search.
4
+ * The existing search runs `LIKE '%needle%'` against client name/email and
5
+ * user email/firstName/lastName/userName/companyName — leading-wildcard scans
6
+ * on ~340k-row tables that cost 150ms-2s wall depending on needle rarity.
7
+ *
8
+ * The ngram parser tokenizes by 2-character grams (default), so substring
9
+ * queries like "gusov" hit "gusovsky" via shared tokens. Repository code
10
+ * issues `MATCH ... AGAINST` predicates and falls back to LIKE when the
11
+ * needle is shorter than the ngram token size.
12
+ */
13
+ export declare class addQuickSearchFulltextIndexes1746434400000 implements MigrationInterface {
14
+ up(queryRunner: QueryRunner): Promise<void>;
15
+ down(queryRunner: QueryRunner): Promise<void>;
16
+ }
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * FULLTEXT (ngram) indexes to back jarvis-web's cross-entity quick-search.
5
+ * The existing search runs `LIKE '%needle%'` against client name/email and
6
+ * user email/firstName/lastName/userName/companyName — leading-wildcard scans
7
+ * on ~340k-row tables that cost 150ms-2s wall depending on needle rarity.
8
+ *
9
+ * The ngram parser tokenizes by 2-character grams (default), so substring
10
+ * queries like "gusov" hit "gusovsky" via shared tokens. Repository code
11
+ * issues `MATCH ... AGAINST` predicates and falls back to LIKE when the
12
+ * needle is shorter than the ngram token size.
13
+ */
14
+ class addQuickSearchFulltextIndexes1746434400000 {
15
+ async up(queryRunner) {
16
+ await queryRunner.query('ALTER TABLE `client` ADD FULLTEXT INDEX `ftClientSearch` (`name`, `email`) WITH PARSER ngram');
17
+ await queryRunner.query('ALTER TABLE `user` ADD FULLTEXT INDEX `ftUserSearch` (`email`, `firstName`, `lastName`, `userName`, `companyName`) WITH PARSER ngram');
18
+ }
19
+ async down(queryRunner) {
20
+ await queryRunner.query('ALTER TABLE `client` DROP INDEX `ftClientSearch`');
21
+ await queryRunner.query('ALTER TABLE `user` DROP INDEX `ftUserSearch`');
22
+ }
23
+ }
24
+
25
+ exports.addQuickSearchFulltextIndexes1746434400000 = addQuickSearchFulltextIndexes1746434400000;
@@ -1,11 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var _1684483704434AddLowerCaseIndex = require('../1684483704434-addLowerCaseIndex.js');
4
3
  var _1684483705001UpdateSecurityUserViewsV1 = require('../1684483705001-updateSecurityUserViewsV1.js');
4
+ var _1684483704434AddLowerCaseIndex = require('../1684483704434-addLowerCaseIndex.js');
5
5
  var _1684483705002UpdateSecurityUserViewsV2 = require('../1684483705002-updateSecurityUserViewsV2.js');
6
+ var _1746434400000AddQuickSearchFulltextIndexes = require('../1746434400000-addQuickSearchFulltextIndexes.js');
6
7
 
7
8
 
8
9
 
9
- exports.addLowerCaseIndex1684483704434 = _1684483704434AddLowerCaseIndex.addLowerCaseIndex1684483704434;
10
10
  exports.updateSecurityUserViewsV11684483705001 = _1684483705001UpdateSecurityUserViewsV1.updateSecurityUserViewsV11684483705001;
11
+ exports.addLowerCaseIndex1684483704434 = _1684483704434AddLowerCaseIndex.addLowerCaseIndex1684483704434;
11
12
  exports.updateSecurityUserViewsV21684483705002 = _1684483705002UpdateSecurityUserViewsV2.updateSecurityUserViewsV21684483705002;
13
+ exports.addQuickSearchFulltextIndexes1746434400000 = _1746434400000AddQuickSearchFulltextIndexes.addQuickSearchFulltextIndexes1746434400000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "1.4.221",
3
+ "version": "1.4.222",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/schema.sql CHANGED
@@ -1,6 +1,6 @@
1
- -- nova-orm-schema-checksum: b419d7a77f0d8b5982712d55d014e5bd
1
+ -- nova-orm-schema-checksum: 2d172673b916b5d8e899b7a37a9367e3
2
2
  -- Nova ORM Schema Dump
3
- -- Generated at: 2026-05-01T13:20:17.406Z
3
+ -- Generated at: 2026-05-05T09:59:55.117Z
4
4
 
5
5
  SET FOREIGN_KEY_CHECKS = 0;
6
6
 
@@ -1000,7 +1000,8 @@ CREATE TABLE `client` (
1000
1000
  KEY `ixClientEmail` (`email`),
1001
1001
  KEY `ixClientCreatedAt` (`createdAt`),
1002
1002
  KEY `ixClientClientTypeId` (`clientTypeId`),
1003
- KEY `ixClientEmailLower` ((lower(`email`)))
1003
+ KEY `ixClientEmailLower` ((lower(`email`))),
1004
+ FULLTEXT KEY `ftClientSearch` (`name`,`email`) /*!50100 WITH PARSER `ngram` */
1004
1005
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
1005
1006
 
1006
1007
  DROP TABLE IF EXISTS `clientAlertConfiguration`;
@@ -2283,7 +2284,7 @@ CREATE TABLE `migration` (
2283
2284
  `timestamp` bigint NOT NULL,
2284
2285
  `name` varchar(255) NOT NULL,
2285
2286
  PRIMARY KEY (`id`)
2286
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
2287
+ ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
2287
2288
 
2288
2289
  DROP TABLE IF EXISTS `mobileNetwork`;
2289
2290
  CREATE TABLE `mobileNetwork` (
@@ -3164,7 +3165,8 @@ CREATE TABLE `user` (
3164
3165
  KEY `ixUserClientId` (`clientId`),
3165
3166
  KEY `ixUserEmailLower` ((lower(`email`))),
3166
3167
  KEY `ixUserNameLower` ((lower(`userName`))),
3167
- KEY `ixPreferredUserNameLower` ((lower(`preferredUserName`)))
3168
+ KEY `ixPreferredUserNameLower` ((lower(`preferredUserName`))),
3169
+ FULLTEXT KEY `ftUserSearch` (`email`,`firstName`,`lastName`,`userName`,`companyName`) /*!50100 WITH PARSER `ngram` */
3168
3170
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
3169
3171
 
3170
3172
  DROP TABLE IF EXISTS `userActivation`;