tomsun28 commented on code in PR #3735:
URL: https://github.com/apache/hertzbeat/pull/3735#discussion_r2325450971


##########
hertzbeat-manager/src/main/resources/db/migration/h2/V174__update_column.sql:
##########
@@ -0,0 +1,29 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- ensure every sql can rerun without error
+
+CREATE TABLE IF NOT EXISTS hzb_metrics_favorite (
+    id BIGINT AUTO_INCREMENT PRIMARY KEY,
+    creator VARCHAR(255) NOT NULL,
+    monitor_id BIGINT NOT NULL,
+    metrics_name VARCHAR(255) NOT NULL,
+    create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
+
+-- Create unique index for hzb_metrics_favorite table
+CREATE UNIQUE INDEX IF NOT EXISTS uk_monitor_metrics ON hzb_metrics_favorite 
(creator, monitor_id, metrics_name);

Review Comment:
   hi @Duansg  suggest avoiding the use of Flyway unless it’s necessary, as it 
has shown instability when handling upgrades across different versions.  our 
previous tables were not managed through Flyway, it should only be used when it 
is truly necessary for modifying table fields or data.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org
For additional commands, e-mail: notifications-h...@hertzbeat.apache.org

Reply via email to