Skip to content

Commit e7c7d66

Browse files
pmbrullclaude
andcommitted
chore(bootstrap): move context_memory DDL from 2.0.1 to 2.0.0
The context_memory table belongs in the 2.0.0 migration. Relocated the MySQL and Postgres DDL verbatim; the 2.0.1 schemaChanges.sql files are restored to their original task_migration_mapping-only content. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0f14b9a commit e7c7d66

4 files changed

Lines changed: 30 additions & 30 deletions

File tree

bootstrap/sql/migrations/native/2.0.0/mysql/schemaChanges.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,18 @@ CREATE TABLE IF NOT EXISTS search_index_retry_queue (
340340
KEY idx_search_index_retry_queue_status (status),
341341
KEY idx_search_index_retry_queue_claimed_at (claimedAt)
342342
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
343+
344+
-- ContextMemory entity - reusable Context Center memory.
345+
CREATE TABLE IF NOT EXISTS context_memory (
346+
id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL,
347+
name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') STORED NOT NULL,
348+
nameHash VARCHAR(256) NOT NULL COLLATE ascii_bin,
349+
json JSON NOT NULL,
350+
updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') STORED NOT NULL,
351+
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') STORED NOT NULL,
352+
deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') STORED,
353+
354+
PRIMARY KEY (id),
355+
UNIQUE KEY unique_context_memory_name (nameHash),
356+
INDEX idx_context_memory_updated_at (updatedAt)
357+
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

bootstrap/sql/migrations/native/2.0.0/postgres/schemaChanges.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,18 @@ CREATE INDEX IF NOT EXISTS idx_search_index_retry_queue_status
291291
ON search_index_retry_queue (status);
292292
CREATE INDEX IF NOT EXISTS idx_search_index_retry_queue_claimed_at
293293
ON search_index_retry_queue (claimedAt);
294+
295+
-- ContextMemory entity - reusable Context Center memory.
296+
CREATE TABLE IF NOT EXISTS context_memory (
297+
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
298+
name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL,
299+
nameHash VARCHAR(256) NOT NULL,
300+
json JSONB NOT NULL,
301+
updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL,
302+
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL,
303+
deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED,
304+
305+
PRIMARY KEY (id),
306+
UNIQUE (nameHash)
307+
);
308+
CREATE INDEX IF NOT EXISTS idx_context_memory_updated_at ON context_memory (updatedAt);

bootstrap/sql/migrations/native/2.0.1/mysql/schemaChanges.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,3 @@ CREATE TABLE IF NOT EXISTS task_migration_mapping (
99
PRIMARY KEY (old_thread_id),
1010
KEY idx_task_migration_mapping_new_task_id (new_task_id)
1111
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
12-
13-
-- ContextMemory entity - reusable Context Center memory.
14-
CREATE TABLE IF NOT EXISTS context_memory (
15-
id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL,
16-
name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') STORED NOT NULL,
17-
nameHash VARCHAR(256) NOT NULL COLLATE ascii_bin,
18-
json JSON NOT NULL,
19-
updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') STORED NOT NULL,
20-
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') STORED NOT NULL,
21-
deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') STORED,
22-
23-
PRIMARY KEY (id),
24-
UNIQUE KEY unique_context_memory_name (nameHash),
25-
INDEX idx_context_memory_updated_at (updatedAt)
26-
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

bootstrap/sql/migrations/native/2.0.1/postgres/schemaChanges.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,3 @@ CREATE TABLE IF NOT EXISTS task_migration_mapping (
1111

1212
CREATE INDEX IF NOT EXISTS idx_task_migration_mapping_new_task_id
1313
ON task_migration_mapping (new_task_id);
14-
15-
-- ContextMemory entity - reusable Context Center memory.
16-
CREATE TABLE IF NOT EXISTS context_memory (
17-
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
18-
name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL,
19-
nameHash VARCHAR(256) NOT NULL,
20-
json JSONB NOT NULL,
21-
updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL,
22-
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL,
23-
deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED,
24-
25-
PRIMARY KEY (id),
26-
UNIQUE (nameHash)
27-
);
28-
CREATE INDEX IF NOT EXISTS idx_context_memory_updated_at ON context_memory (updatedAt);

0 commit comments

Comments
 (0)