-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Server] add agent config platform_sync_interval
- Loading branch information
1 parent
89dc540
commit bc0c8c9
Showing
13 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
server/controller/db/mysql/migration/rawsql/issu/6.5.1.16.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- modify start, add upgrade sql | ||
DROP PROCEDURE IF EXISTS AddColumnIfNotExists; | ||
|
||
CREATE PROCEDURE AddColumnIfNotExists( | ||
IN tableName VARCHAR(255), | ||
IN colName VARCHAR(255), | ||
IN colType VARCHAR(255) | ||
) | ||
BEGIN | ||
DECLARE column_count INT; | ||
|
||
-- 检查列是否存在 | ||
SELECT COUNT(*) | ||
INTO column_count | ||
FROM information_schema.columns | ||
WHERE table_name = tableName | ||
AND column_name = colName; | ||
|
||
-- 如果列不存在,则添加列 | ||
IF column_count = 0 THEN | ||
SET @sql = CONCAT('ALTER TABLE ', tableName, ' ADD COLUMN ', colName, ' ', colType, ' DEFAULT NULL AFTER max_memory'); | ||
PREPARE stmt FROM @sql; | ||
EXECUTE stmt; | ||
DEALLOCATE PREPARE stmt; | ||
END IF; | ||
END; | ||
|
||
CALL AddColumnIfNotExists('vtap_group_configuration', 'platform_sync_interval', 'INTEGER'); | ||
|
||
DROP PROCEDURE AddColumnIfNotExists; | ||
|
||
|
||
|
||
-- update db_version to latest, remeber update DB_VERSION_EXPECT in migrate/init.go | ||
UPDATE db_version SET version='6.5.1.16'; | ||
-- modify end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters