mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 16:17:25 +00:00
fix(skills): add missing tenant_id to UpsertSystemSkill INSERT
After migration 000027 dropped the tenant_id default on skills table, new system skill inserts failed with NOT NULL constraint violation.
This commit is contained in:
1 parent
461397d710
commit
e156e47343
1 file changed
+3
-3
@@ -57,10 +57,10 @@ func (s *PGSkillStore) UpsertSystemSkill(ctx context.Context, p SkillCreateParam
|
||||
fmJSON := marshalFrontmatter(p.Frontmatter)
|
||||
_, err = s.db.ExecContext(ctx,
|
||||
`INSERT INTO skills (id, name, slug, description, owner_id, visibility, version, status,
|
||||
is_system, frontmatter, file_path, file_size, file_hash, created_at, updated_at)
|
||||
VALUES ($1, $2, $3, $4, 'system', 'public', $5, $6, true, $7, $8, $9, $10, NOW(), NOW())`,
|
||||
is_system, frontmatter, file_path, file_size, file_hash, tenant_id, created_at, updated_at)
|
||||
VALUES ($1, $2, $3, $4, 'system', 'public', $5, $6, true, $7, $8, $9, $10, $11, NOW(), NOW())`,
|
||||
id, p.Name, p.Slug, p.Description, p.Version, p.Status,
|
||||
fmJSON, p.FilePath, p.FileSize, p.FileHash,
|
||||
fmJSON, p.FilePath, p.FileSize, p.FileHash, store.MasterTenantID,
|
||||
)
|
||||
if err != nil {
|
||||
return uuid.Nil, false, "", fmt.Errorf("insert system skill: %w", err)
|
||||
|
||||
Reference in new issue
Block a user