@elizaos/plugin-sql 1.0.0-beta.38 → 1.0.0-beta.40

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,3 @@
1
+ CREATE EXTENSION IF NOT EXISTS vector;
2
+ --> statement-breakpoint
3
+ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
@@ -1,7 +1,6 @@
1
- CREATE EXTENSION IF NOT EXISTS vector;
2
- --> statement-breakpoint
3
- CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
4
- --> statement-breakpoint
1
+ CREATE EXTENSION IF NOT EXISTS vector;--> statement-breakpoint
2
+ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;--> statement-breakpoint
3
+
5
4
  CREATE TABLE "agents" (
6
5
  "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
7
6
  "enabled" boolean DEFAULT true NOT NULL,
@@ -83,6 +82,7 @@ CREATE TABLE "memories" (
83
82
  "entityId" uuid,
84
83
  "agentId" uuid,
85
84
  "roomId" uuid,
85
+ "worldId" uuid,
86
86
  "unique" boolean DEFAULT true NOT NULL,
87
87
  "metadata" jsonb DEFAULT '{}'::jsonb NOT NULL,
88
88
  CONSTRAINT "fragment_metadata_check" CHECK (
@@ -173,9 +173,11 @@ ALTER TABLE "logs" ADD CONSTRAINT "fk_user" FOREIGN KEY ("entityId") REFERENCES
173
173
  ALTER TABLE "memories" ADD CONSTRAINT "memories_entityId_entities_id_fk" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
174
174
  ALTER TABLE "memories" ADD CONSTRAINT "memories_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
175
175
  ALTER TABLE "memories" ADD CONSTRAINT "memories_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
176
+ ALTER TABLE "memories" ADD CONSTRAINT "memories_worldId_worlds_id_fk" FOREIGN KEY ("worldId") REFERENCES "public"."worlds"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
176
177
  ALTER TABLE "memories" ADD CONSTRAINT "fk_room" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
177
178
  ALTER TABLE "memories" ADD CONSTRAINT "fk_user" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
178
- ALTER TABLE "memories" ADD CONSTRAINT "fk_agent" FOREIGN KEY ("agentId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
179
+ ALTER TABLE "memories" ADD CONSTRAINT "fk_agent" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
180
+ ALTER TABLE "memories" ADD CONSTRAINT "fk_world" FOREIGN KEY ("worldId") REFERENCES "public"."worlds"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
179
181
  ALTER TABLE "participants" ADD CONSTRAINT "participants_entityId_entities_id_fk" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
180
182
  ALTER TABLE "participants" ADD CONSTRAINT "participants_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
181
183
  ALTER TABLE "participants" ADD CONSTRAINT "participants_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
@@ -191,6 +193,7 @@ ALTER TABLE "rooms" ADD CONSTRAINT "rooms_worldId_worlds_id_fk" FOREIGN KEY ("wo
191
193
  ALTER TABLE "worlds" ADD CONSTRAINT "worlds_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
192
194
  CREATE INDEX "idx_embedding_memory" ON "embeddings" USING btree ("memory_id");--> statement-breakpoint
193
195
  CREATE INDEX "idx_memories_type_room" ON "memories" USING btree ("type","roomId");--> statement-breakpoint
196
+ CREATE INDEX "idx_memories_world_id" ON "memories" USING btree ("worldId");--> statement-breakpoint
194
197
  CREATE INDEX "idx_memories_metadata_type" ON "memories" USING btree (((metadata->>'type')));--> statement-breakpoint
195
198
  CREATE INDEX "idx_memories_document_id" ON "memories" USING btree (((metadata->>'documentId')));--> statement-breakpoint
196
199
  CREATE INDEX "idx_fragments_order" ON "memories" USING btree (((metadata->>'documentId')),((metadata->>'position')));--> statement-breakpoint
@@ -1,6 +1,6 @@
1
1
  {
2
- "id": "a7cd2a8d-b5fb-40c3-b277-b080be70732e",
3
- "prevId": "e868cf2d-10a2-406f-a31e-9342a0f29c35",
2
+ "id": "8d7ae0aa-76b7-4e80-9133-db45fb9b6d1e",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
6
6
  "tables": {
@@ -620,6 +620,12 @@
620
620
  "primaryKey": false,
621
621
  "notNull": false
622
622
  },
623
+ "worldId": {
624
+ "name": "worldId",
625
+ "type": "uuid",
626
+ "primaryKey": false,
627
+ "notNull": false
628
+ },
623
629
  "unique": {
624
630
  "name": "unique",
625
631
  "type": "boolean",
@@ -657,6 +663,21 @@
657
663
  "method": "btree",
658
664
  "with": {}
659
665
  },
666
+ "idx_memories_world_id": {
667
+ "name": "idx_memories_world_id",
668
+ "columns": [
669
+ {
670
+ "expression": "worldId",
671
+ "isExpression": false,
672
+ "asc": true,
673
+ "nulls": "last"
674
+ }
675
+ ],
676
+ "isUnique": false,
677
+ "concurrently": false,
678
+ "method": "btree",
679
+ "with": {}
680
+ },
660
681
  "idx_memories_metadata_type": {
661
682
  "name": "idx_memories_metadata_type",
662
683
  "columns": [
@@ -737,6 +758,15 @@
737
758
  "onDelete": "cascade",
738
759
  "onUpdate": "no action"
739
760
  },
761
+ "memories_worldId_worlds_id_fk": {
762
+ "name": "memories_worldId_worlds_id_fk",
763
+ "tableFrom": "memories",
764
+ "tableTo": "worlds",
765
+ "columnsFrom": ["worldId"],
766
+ "columnsTo": ["id"],
767
+ "onDelete": "set null",
768
+ "onUpdate": "no action"
769
+ },
740
770
  "fk_room": {
741
771
  "name": "fk_room",
742
772
  "tableFrom": "memories",
@@ -763,6 +793,15 @@
763
793
  "columnsTo": ["id"],
764
794
  "onDelete": "cascade",
765
795
  "onUpdate": "no action"
796
+ },
797
+ "fk_world": {
798
+ "name": "fk_world",
799
+ "tableFrom": "memories",
800
+ "tableTo": "worlds",
801
+ "columnsFrom": ["worldId"],
802
+ "columnsTo": ["id"],
803
+ "onDelete": "set null",
804
+ "onUpdate": "no action"
766
805
  }
767
806
  },
768
807
  "compositePrimaryKeys": {},
@@ -5,15 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1740921883121,
9
- "tag": "20250302132443_init",
10
- "breakpoints": true
11
- },
12
- {
13
- "idx": 1,
14
- "version": "7",
15
- "when": 1744729017905,
16
- "tag": "0001_third_tyger_tiger",
8
+ "when": 1745909982134,
9
+ "tag": "0000_low_anita_blake",
17
10
  "breakpoints": true
18
11
  }
19
12
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-sql",
3
- "version": "1.0.0-beta.38",
3
+ "version": "1.0.0-beta.40",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@electric-sql/pglite": "^0.2.17",
30
- "@elizaos/core": "^1.0.0-beta.38",
30
+ "@elizaos/core": "^1.0.0-beta.40",
31
31
  "@types/pg": "8.11.10",
32
32
  "drizzle-kit": "^0.30.4",
33
33
  "drizzle-orm": "^0.39.1",
@@ -58,5 +58,5 @@
58
58
  "typescript": "5.8.2",
59
59
  "whatwg-url": "7.1.0"
60
60
  },
61
- "gitHead": "b24230fa4d05078c5d93522413799411b239d7f3"
61
+ "gitHead": "fc75473bb1535968d0c473ec6ae614b86feec202"
62
62
  }
@@ -1,4 +0,0 @@
1
- ALTER TABLE "memories" DROP CONSTRAINT "fk_agent";
2
- --> statement-breakpoint
3
- ALTER TABLE "agents" ALTER COLUMN "enabled" SET DEFAULT true;--> statement-breakpoint
4
- ALTER TABLE "memories" ADD CONSTRAINT "fk_agent" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;