From 16a700453de0c24618c6cabf212f37f200b1b2bc Mon Sep 17 00:00:00 2001 From: fly_mc Date: Sun, 29 Sep 2024 01:07:46 +0800 Subject: [PATCH] use PGroonga --- .../migration/1652210810723-PGroonga.js | 11 ++++ .../1652213168020-PGroongaUserName.js | 11 ++++ .../1652213556290-PGroongaUserDescription.js | 11 ++++ .../migration/1727542814489-Pgroonga.js | 16 ++++++ pgroonga.diff | 51 +++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 packages/backend/migration/1652210810723-PGroonga.js create mode 100644 packages/backend/migration/1652213168020-PGroongaUserName.js create mode 100644 packages/backend/migration/1652213556290-PGroongaUserDescription.js create mode 100644 packages/backend/migration/1727542814489-Pgroonga.js create mode 100644 pgroonga.diff diff --git a/packages/backend/migration/1652210810723-PGroonga.js b/packages/backend/migration/1652210810723-PGroonga.js new file mode 100644 index 000000000..bd3fee34e --- /dev/null +++ b/packages/backend/migration/1652210810723-PGroonga.js @@ -0,0 +1,11 @@ +export class PGroonga1652210810723 { + name = 'PGroonga1652210810723' + + async up(queryRunner) { + await queryRunner.query(`CREATE INDEX "IDX_f27f5d88941e57442be75ba9c8" ON "note" USING "pgroonga" ("text")`); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_f27f5d88941e57442be75ba9c8"`); + } +} diff --git a/packages/backend/migration/1652213168020-PGroongaUserName.js b/packages/backend/migration/1652213168020-PGroongaUserName.js new file mode 100644 index 000000000..9e1e75ece --- /dev/null +++ b/packages/backend/migration/1652213168020-PGroongaUserName.js @@ -0,0 +1,11 @@ +export class PGroongaUserName1652213168020 { + name = 'PGroongaUserName1652213168020' + + async up(queryRunner) { + await queryRunner.query(`CREATE INDEX "IDX_065d4d8f3b5adb4a08841eae3c" ON "user" USING "pgroonga" ("name" pgroonga_varchar_full_text_search_ops_v2)`); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_065d4d8f3b5adb4a08841eae3c"`); + } +} diff --git a/packages/backend/migration/1652213556290-PGroongaUserDescription.js b/packages/backend/migration/1652213556290-PGroongaUserDescription.js new file mode 100644 index 000000000..7216438ab --- /dev/null +++ b/packages/backend/migration/1652213556290-PGroongaUserDescription.js @@ -0,0 +1,11 @@ +export class PGroongaUserDescription1652213556290 { + name = 'PGroongaUserDescription1652213556290' + + async up(queryRunner) { + await queryRunner.query(`CREATE INDEX "IDX_fcb770976ff8240af5799e3ffc" ON "user_profile" USING "pgroonga" ("description" pgroonga_varchar_full_text_search_ops_v2) `); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_fcb770976ff8240af5799e3ffc"`); + } +} diff --git a/packages/backend/migration/1727542814489-Pgroonga.js b/packages/backend/migration/1727542814489-Pgroonga.js new file mode 100644 index 000000000..b8e3e4a46 --- /dev/null +++ b/packages/backend/migration/1727542814489-Pgroonga.js @@ -0,0 +1,16 @@ +export class Pgroonga1727542814489 { + name = 'Pgroonga1727542814489' + + async up(queryRunner) { + await queryRunner.query(`CREATE INDEX "IDX_f27f5d88941e57442be75ba9c8" ON "note" USING "pgroonga" ("text")`); + await queryRunner.query(`CREATE INDEX "IDX_065d4d8f3b5adb4a08841eae3c" ON "user" USING "pgroonga" ("name" pgroonga_varchar_full_text_search_ops_v2)`); + await queryRunner.query(`CREATE INDEX "IDX_fcb770976ff8240af5799e3ffc" ON "user_profile" USING "pgroonga" ("description" pgroonga_varchar_full_text_search_ops_v2) `); + + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_f27f5d88941e57442be75ba9c8"`); + await queryRunner.query(`DROP INDEX "public"."IDX_065d4d8f3b5adb4a08841eae3c"`); + await queryRunner.query(`DROP INDEX "public"."IDX_fcb770976ff8240af5799e3ffc"`); + } +} \ No newline at end of file diff --git a/pgroonga.diff b/pgroonga.diff new file mode 100644 index 000000000..c960ba5d9 --- /dev/null +++ b/pgroonga.diff @@ -0,0 +1,51 @@ +diff --git a/packages/backend/migration/1652210810723-PGroonga.js b/packages/backend/migration/1652210810723-PGroonga.js +new file mode 100644 +index 000000000..bd3fee34e +--- /dev/null ++++ b/packages/backend/migration/1652210810723-PGroonga.js +@@ -0,0 +1,11 @@ ++export class PGroonga1652210810723 { ++ name = 'PGroonga1652210810723' ++ ++ async up(queryRunner) { ++ await queryRunner.query(`CREATE INDEX "IDX_f27f5d88941e57442be75ba9c8" ON "note" USING "pgroonga" ("text")`); ++ } ++ ++ async down(queryRunner) { ++ await queryRunner.query(`DROP INDEX "public"."IDX_f27f5d88941e57442be75ba9c8"`); ++ } ++} +diff --git a/packages/backend/migration/1652213168020-PGroongaUserName.js b/packages/backend/migration/1652213168020-PGroongaUserName.js +new file mode 100644 +index 000000000..9e1e75ece +--- /dev/null ++++ b/packages/backend/migration/1652213168020-PGroongaUserName.js +@@ -0,0 +1,11 @@ ++export class PGroongaUserName1652213168020 { ++ name = 'PGroongaUserName1652213168020' ++ ++ async up(queryRunner) { ++ await queryRunner.query(`CREATE INDEX "IDX_065d4d8f3b5adb4a08841eae3c" ON "user" USING "pgroonga" ("name" pgroonga_varchar_full_text_search_ops_v2)`); ++ } ++ ++ async down(queryRunner) { ++ await queryRunner.query(`DROP INDEX "public"."IDX_065d4d8f3b5adb4a08841eae3c"`); ++ } ++} +diff --git a/packages/backend/migration/1652213556290-PGroongaUserDescription.js b/packages/backend/migration/1652213556290-PGroongaUserDescription.js +new file mode 100644 +index 000000000..7216438ab +--- /dev/null ++++ b/packages/backend/migration/1652213556290-PGroongaUserDescription.js +@@ -0,0 +1,11 @@ ++export class PGroongaUserDescription1652213556290 { ++ name = 'PGroongaUserDescription1652213556290' ++ ++ async up(queryRunner) { ++ await queryRunner.query(`CREATE INDEX "IDX_fcb770976ff8240af5799e3ffc" ON "user_profile" USING "pgroonga" ("description" pgroonga_varchar_full_text_search_ops_v2) `); ++ } ++ ++ async down(queryRunner) { ++ await queryRunner.query(`DROP INDEX "public"."IDX_fcb770976ff8240af5799e3ffc"`); ++ } ++}