fjtirado commented on code in PR #2191: URL: https://github.com/apache/incubator-kie-kogito-apps/pull/2191#discussion_r1959416202
########## data-index/data-index-storage/data-index-storage-jpa/src/main/resources/kie-flyway/db/data-index/ansi/V1.45.1.0__metadata_as_column.sql: ########## @@ -0,0 +1,38 @@ +/* + * 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. + */ + +ALTER TABLE definitions ADD COLUMN metadata varchar(max); + +/* Migration for postgresql and sql server + UPDATE definitions SET metadata = +(SELECT string_agg(name || '=' || meta_value, ',') FROM definitions_metadata where process_id = a.process_id and process_version = a.process_version) +FROM definitions_metadata as a +WHERE process_id = a.process_id and process_version = a.process_version; +*/ + + +/* Migration for h2 and oracle + UPDATE definitions SET metadata = +(SELECT listagg(name || '=' || meta_value, ',') FROM definitions_metadata where process_id = a.process_id and process_version = a.process_version) +FROM definitions_metadata as a +WHERE process_id = a.process_id and process_version = a.process_version; +*/ + +/* Since migration is disable, do not delete not longer used table + * DROP TABLE definitions_metadata;*/ Review Comment: I think, in this case, as an exception, it is worth to keep it in case users want to manually execute the script for their DB. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
