Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
35 lines
970 B
Go
35 lines
970 B
Go
package storesqlite
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
func (s *Store) applyWorkspaceAgentMessageSemanticsV1(ctx context.Context) error {
|
|
applied, err := s.hasMigration(ctx, schemaMigrationWorkspaceAgentMessageSemanticsV1)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := s.ensureWorkspaceAgentMessageSemanticsColumn(ctx); err != nil {
|
|
return err
|
|
}
|
|
if applied {
|
|
return nil
|
|
}
|
|
return s.recordMigration(ctx, schemaMigrationWorkspaceAgentMessageSemanticsV1)
|
|
}
|
|
|
|
func (s *Store) ensureWorkspaceAgentMessageSemanticsColumn(ctx context.Context) error {
|
|
hasSemantics, err := s.hasColumn(ctx, "workspace_agent_messages", "semantics_json")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hasSemantics {
|
|
return nil
|
|
}
|
|
if _, err := s.db.ExecContext(ctx, `ALTER TABLE workspace_agent_messages ADD COLUMN semantics_json TEXT NOT NULL DEFAULT 'null' CHECK (json_valid(semantics_json));`); err != nil {
|
|
return fmt.Errorf("migrate workspace agent message semantics: %w", err)
|
|
}
|
|
return nil
|
|
}
|