-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow counters to be created with same name, provider and source as a deleted one #10223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
294696d
Allow counters to be created with same name, provider and source as d…
Pearl1594 fdb9a71
fix api response
Pearl1594 7a1e54d
drop unique key only if it exists
Pearl1594 2ace4dd
create a procedure
Pearl1594 96691f6
Merge branch '4.19' into fix-create-counters-dup
DaanHoogland 6b5ece3
Update engine/schema/src/main/resources/META-INF/db/schema-41910to419…
DaanHoogland e80c713
Merge branch '4.20' of https://github.com/apache/cloudstack into fix-…
Pearl1594 1ee387d
move query to 4.20.1 schema file
Pearl1594 11f1217
prevent addition of counters with same name, provider and source as a…
Pearl1594 d106b8b
Merge branch '4.20' of https://github.com/apache/cloudstack into fix-…
Pearl1594 cb0f178
prevent counters with same value for the same provider
Pearl1594 ea739eb
lint and license check failure addressed
Pearl1594 a92a2ae
address comment
Pearl1594 1efc0a5
fix upgrade path
Pearl1594 2521172
fix check to allow counters with same name but different values
Pearl1594 e07dc68
Merge branch 'main' of https://github.com/apache/cloudstack into fix-…
Pearl1594 002d3f8
move schema changes to 4.22 path
Pearl1594 5d30323
lint
Pearl1594 087244d
Merge branch 'main' of https://github.com/apache/cloudstack into fix-…
Pearl1594 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
26 changes: 26 additions & 0 deletions
26
engine/schema/src/main/resources/META-INF/db/procedures/cloud.idempotent_drop_unique_key.sql
This file contains hidden or 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,26 @@ | ||
| -- 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. | ||
|
|
||
| -- in cloud | ||
| DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_DROP_UNIQUE_KEY`; | ||
|
|
||
| CREATE PROCEDURE `cloud`.`IDEMPOTENT_DROP_UNIQUE_KEY` ( | ||
| IN in_table_name VARCHAR(200), | ||
| IN in_index_name VARCHAR(200) | ||
| ) | ||
| BEGIN | ||
| DECLARE CONTINUE HANDLER FOR 1091, 1025 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name, ' DROP KEY ', in_index_name); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -1474,6 +1474,12 @@ public Counter createCounter(CreateCounterCmd cmd) { | |
| return counter; | ||
| } | ||
|
|
||
| @Override | ||
| @ActionEvent(eventType = EventTypes.EVENT_COUNTER_CREATE, eventDescription = "Creating a counter", async = true) | ||
| public Counter getCounter(long counterId) { | ||
| return counterDao.findById(counterId); | ||
| } | ||
|
Comment on lines
+1488
to
+1492
|
||
|
|
||
| @Override | ||
| @ActionEvent(eventType = EventTypes.EVENT_CONDITION_CREATE, eventDescription = "Condition", create = true) | ||
| public Condition createCondition(CreateConditionCmd cmd) { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.