File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22-- Adds global_context and project_context columns to projects table
33-- for per-project customizable AI context
44
5- -- Add context columns to projects table
6- ALTER TABLE projects
7- ADD COLUMN global_context TEXT COMMENT ' Customized global context for this project' AFTER context,
8- ADD COLUMN project_context TEXT COMMENT ' Language-specific context for this project' AFTER global_context;
5+ -- Add context columns to projects table (if they don't exist)
6+ SET @dbname = DATABASE();
7+
8+ SELECT COUNT (* ) INTO @col_exists FROM information_schema .columns
9+ WHERE table_schema = @dbname AND table_name = ' projects' AND column_name = ' global_context' ;
10+ SET @sql = IF(@col_exists = 0 ,
11+ ' ALTER TABLE projects ADD COLUMN global_context TEXT COMMENT ' ' Customized global context for this project' ' AFTER context' ,
12+ ' SELECT 1' );
13+ PREPARE stmt FROM @sql;
14+ EXECUTE stmt;
15+ DEALLOCATE PREPARE stmt;
16+
17+ SELECT COUNT (* ) INTO @col_exists FROM information_schema .columns
18+ WHERE table_schema = @dbname AND table_name = ' projects' AND column_name = ' project_context' ;
19+ SET @sql = IF(@col_exists = 0 ,
20+ ' ALTER TABLE projects ADD COLUMN project_context TEXT COMMENT ' ' Language-specific context for this project' ' AFTER global_context' ,
21+ ' SELECT 1' );
22+ PREPARE stmt FROM @sql;
23+ EXECUTE stmt;
24+ DEALLOCATE PREPARE stmt;
925
1026-- Update schema_migrations
1127INSERT INTO schema_migrations (version) VALUES (' 2.83.0' )
You can’t perform that action at this time.
0 commit comments