Commit b0cf5601f40c6a7e59aa4cb77ed1f15115cb2c3f
Merge branch 'master' into master_dev
# Conflicts: # common/data/src/main/java/org/thingsboard/server/common/data/yunteng/core/utils/LocalFileStorageService.java # common/data/src/main/java/org/thingsboard/server/common/data/yunteng/core/utils/MinioFileStorageService.java
Showing
6 changed files
with
105 additions
and
1 deletions
1 | +-- | ||
2 | +-- Copyright © 2016-2024 The Thingsboard Authors | ||
3 | +-- | ||
4 | +-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | +-- you may not use this file except in compliance with the License. | ||
6 | +-- You may obtain a copy of the License at | ||
7 | +-- | ||
8 | +-- http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | +-- | ||
10 | +-- Unless required by applicable law or agreed to in writing, software | ||
11 | +-- distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | +-- See the License for the specific language governing permissions and | ||
14 | +-- limitations under the License. | ||
15 | +-- | ||
16 | + | ||
17 | +CREATE KEYSPACE IF NOT EXISTS thingsboard | ||
18 | +WITH replication = { | ||
19 | + 'class' : 'SimpleStrategy', | ||
20 | + 'replication_factor' : 1 | ||
21 | +}; |
1 | +-- | ||
2 | +-- Copyright © 2016-2024 The Thingsboard Authors | ||
3 | +-- | ||
4 | +-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | +-- you may not use this file except in compliance with the License. | ||
6 | +-- You may obtain a copy of the License at | ||
7 | +-- | ||
8 | +-- http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | +-- | ||
10 | +-- Unless required by applicable law or agreed to in writing, software | ||
11 | +-- distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | +-- See the License for the specific language governing permissions and | ||
14 | +-- limitations under the License. | ||
15 | +-- | ||
16 | + | ||
17 | +CREATE TABLE IF NOT EXISTS thingsboard.ts_kv_latest_cf ( | ||
18 | + entity_type text, -- (DEVICE, CUSTOMER, TENANT) | ||
19 | + entity_id timeuuid, | ||
20 | + key text, | ||
21 | + ts bigint, | ||
22 | + bool_v boolean, | ||
23 | + str_v text, | ||
24 | + long_v bigint, | ||
25 | + dbl_v double, | ||
26 | + json_v text, | ||
27 | + PRIMARY KEY (( entity_type, entity_id ), key) | ||
28 | +) WITH compaction = { 'class' : 'LeveledCompactionStrategy' }; |
1 | +-- | ||
2 | +-- Copyright © 2016-2024 The Thingsboard Authors | ||
3 | +-- | ||
4 | +-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | +-- you may not use this file except in compliance with the License. | ||
6 | +-- You may obtain a copy of the License at | ||
7 | +-- | ||
8 | +-- http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | +-- | ||
10 | +-- Unless required by applicable law or agreed to in writing, software | ||
11 | +-- distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | +-- See the License for the specific language governing permissions and | ||
14 | +-- limitations under the License. | ||
15 | +-- | ||
16 | + | ||
17 | +CREATE TABLE IF NOT EXISTS thingsboard.ts_kv_cf ( | ||
18 | + entity_type text, -- (DEVICE, CUSTOMER, TENANT) | ||
19 | + entity_id timeuuid, | ||
20 | + key text, | ||
21 | + partition bigint, | ||
22 | + ts bigint, | ||
23 | + bool_v boolean, | ||
24 | + str_v text, | ||
25 | + long_v bigint, | ||
26 | + dbl_v double, | ||
27 | + json_v text, | ||
28 | + PRIMARY KEY (( entity_type, entity_id, key, partition ), ts) | ||
29 | +); | ||
30 | + | ||
31 | +CREATE TABLE IF NOT EXISTS thingsboard.ts_kv_partitions_cf ( | ||
32 | + entity_type text, -- (DEVICE, CUSTOMER, TENANT) | ||
33 | + entity_id timeuuid, | ||
34 | + key text, | ||
35 | + partition bigint, | ||
36 | + PRIMARY KEY (( entity_type, entity_id, key ), partition) | ||
37 | +) WITH CLUSTERING ORDER BY ( partition ASC ) | ||
38 | + AND compaction = { 'class' : 'LeveledCompactionStrategy' }; |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | -- | 15 | -- |
16 | 16 | ||
17 | -- NOTIFICATIONS UPDATE START | 17 | -- NOTIFICATIONS UPDATE START |
18 | - | 18 | +ALTER TABLE device_profile ADD is_data_combination boolean DEFAULT false; |
19 | ALTER TABLE notification ADD COLUMN IF NOT EXISTS delivery_method VARCHAR(50) NOT NULL default 'WEB'; | 19 | ALTER TABLE notification ADD COLUMN IF NOT EXISTS delivery_method VARCHAR(50) NOT NULL default 'WEB'; |
20 | 20 | ||
21 | DROP INDEX IF EXISTS idx_notification_recipient_id_created_time; | 21 | DROP INDEX IF EXISTS idx_notification_recipient_id_created_time; |
@@ -33,6 +33,7 @@ import org.thingsboard.server.common.data.page.PageDataIterable; | @@ -33,6 +33,7 @@ import org.thingsboard.server.common.data.page.PageDataIterable; | ||
33 | import org.thingsboard.server.common.data.query.DynamicValue; | 33 | import org.thingsboard.server.common.data.query.DynamicValue; |
34 | import org.thingsboard.server.common.data.query.FilterPredicateValue; | 34 | import org.thingsboard.server.common.data.query.FilterPredicateValue; |
35 | import org.thingsboard.server.dao.device.DeviceConnectivityConfiguration; | 35 | import org.thingsboard.server.dao.device.DeviceConnectivityConfiguration; |
36 | +import org.thingsboard.server.dao.edge.EdgeEventDao; | ||
36 | import org.thingsboard.server.dao.rule.RuleChainService; | 37 | import org.thingsboard.server.dao.rule.RuleChainService; |
37 | import org.thingsboard.server.dao.settings.AdminSettingsService; | 38 | import org.thingsboard.server.dao.settings.AdminSettingsService; |
38 | import org.thingsboard.server.dao.sql.JpaExecutorService; | 39 | import org.thingsboard.server.dao.sql.JpaExecutorService; |
@@ -67,9 +68,16 @@ public class DefaultDataUpdateService implements DataUpdateService { | @@ -67,9 +68,16 @@ public class DefaultDataUpdateService implements DataUpdateService { | ||
67 | @Autowired | 68 | @Autowired |
68 | DeviceConnectivityConfiguration connectivityConfiguration; | 69 | DeviceConnectivityConfiguration connectivityConfiguration; |
69 | 70 | ||
71 | + @Autowired | ||
72 | + private EdgeEventDao edgeEventDao; | ||
73 | + | ||
70 | @Override | 74 | @Override |
71 | public void updateData(String fromVersion) throws Exception { | 75 | public void updateData(String fromVersion) throws Exception { |
72 | switch (fromVersion) { | 76 | switch (fromVersion) { |
77 | + case "3.5.1": | ||
78 | + log.info("Updating data from version 3.5.1 to 3.6.0 ..."); | ||
79 | + migrateEdgeEvents("Starting edge events migration - adding seq_id column. "); | ||
80 | + break; | ||
73 | case "3.6.0": | 81 | case "3.6.0": |
74 | log.info("Updating data from version 3.6.0 to 3.6.1 ..."); | 82 | log.info("Updating data from version 3.6.0 to 3.6.1 ..."); |
75 | migrateDeviceConnectivity(); | 83 | migrateDeviceConnectivity(); |
@@ -79,6 +87,15 @@ public class DefaultDataUpdateService implements DataUpdateService { | @@ -79,6 +87,15 @@ public class DefaultDataUpdateService implements DataUpdateService { | ||
79 | } | 87 | } |
80 | } | 88 | } |
81 | 89 | ||
90 | + private void migrateEdgeEvents(String logPrefix) { | ||
91 | + boolean skipEdgeEventsMigration = getEnv("TB_SKIP_EDGE_EVENTS_MIGRATION", false); | ||
92 | + if (!skipEdgeEventsMigration) { | ||
93 | + log.info(logPrefix + "Can be skipped with TB_SKIP_EDGE_EVENTS_MIGRATION env variable set to true"); | ||
94 | + edgeEventDao.migrateEdgeEvents(); | ||
95 | + } else { | ||
96 | + log.info("Skipping edge events migration"); | ||
97 | + } | ||
98 | + } | ||
82 | private void migrateDeviceConnectivity() { | 99 | private void migrateDeviceConnectivity() { |
83 | if (adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID, "connectivity") == null) { | 100 | if (adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID, "connectivity") == null) { |
84 | AdminSettings connectivitySettings = new AdminSettings(); | 101 | AdminSettings connectivitySettings = new AdminSettings(); |
application/src/main/java/org/thingsboard/server/service/subscription/TbTimeSeriesSubscription.java
renamed from
application/src/main/java/org/thingsboard/server/service/subscription/TbTimeseriesSubscription.java