-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Server] add deepflow_admin, deepflow_tenant to data source
- Loading branch information
Showing
8 changed files
with
58 additions
and
17 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
32 changes: 32 additions & 0 deletions
32
server/controller/db/mysql/migration/rawsql/issu/6.5.1.42.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,32 @@ | ||
-- modify start, add upgrade sql | ||
DROP PROCEDURE IF EXISTS update_data_sources; | ||
|
||
CREATE PROCEDURE update_data_sources() | ||
BEGIN | ||
DECLARE current_db_name VARCHAR(255); | ||
|
||
START TRANSACTION; | ||
|
||
UPDATE data_source SET display_name='日志-日志数据',retention_time=720 WHERE data_table_collection='application_log.log'; | ||
UPDATE data_source SET display_name='租户侧监控数据', data_table_collection='deepflow_tenant.*' WHERE data_table_collection='deepflow_system.*'; | ||
|
||
-- do migration in default db | ||
|
||
SELECT DATABASE() INTO current_db_name; | ||
IF @defaultDatabaseName = current_db_name THEN | ||
IF NOT EXISTS (SELECT 1 FROM data_source WHERE data_table_collection = 'deepflow_admin.*') THEN | ||
SET @lcuuid = (SELECT UUID()); | ||
INSERT INTO data_source (display_name, data_table_collection, `interval`, retention_time, lcuuid) | ||
VALUES ('管理侧监控数据', 'deepflow_admin.*', 0, 7*24, @lcuuid); | ||
END IF; | ||
END IF; | ||
|
||
COMMIT; | ||
|
||
END; | ||
|
||
CALL update_data_sources(); | ||
|
||
-- whether default db or not, update db_version to latest, remember update DB_VERSION_EXPECT in migrate/init.go | ||
UPDATE db_version SET version='6.5.1.42'; | ||
-- 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