- Added ensureOrg and ensureOrgRepo methods to GiteaClient for centralized organization and repository management. - Updated main application flow to ensure central Gitea readiness at startup. - Introduced prompt-loader for dynamic loading of agent modules and system prompts from disk. - Refactored agent routes to return sub-agent module catalog. - Modified git routes to interact with a central Gitea instance instead of per-user containers. - Updated workflow routes to utilize a unified user actor per user, streamlining job application workflows. - Improved service agent handling with a new lightweight reference type.
33 lines
1.7 KiB
SQL
33 lines
1.7 KiB
SQL
-- Migration: Central Gitea + Unified Actor (changes.md Phase 6)
|
|
-- Renames/replaces per-user Gitea fields with central Gitea repo references.
|
|
-- Simplifies actors table for unified user actor model.
|
|
-- Adds version tracking columns.
|
|
|
|
-- 1. Drop old per-user Gitea columns from user_stacks
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_container_id;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_container_name;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_host;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_http_port;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_ssh_port;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_admin_user;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_admin_token;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_memory_repo;
|
|
|
|
-- 2. Add central Gitea repo fields
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS gitea_repo_name TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS gitea_repo_owner TEXT;
|
|
|
|
-- 3. Add version tracking columns (changes.md §9)
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS image_version TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS migration_version TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS prompt_version TEXT;
|
|
|
|
-- 4. Simplify actors table for unified model
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS sub_type;
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS channel_id;
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS parent_actor_id;
|
|
-- Change kind enum: was ('grow','sub'), now ('user')
|
|
-- Note: Drizzle handles enum changes via application-level migration.
|
|
-- The application code now only uses kind='user'.
|
|
-- Existing rows with kind='grow' or 'sub' will be left as-is (backward compatible reads).
|