Merge pull request #5866 from YevhenBondarenko/fix/upgrade
fixed column name in upgrade query
This commit is contained in:
commit
0166ba8db5
@ -476,9 +476,9 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService
|
|||||||
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.3.2", SCHEMA_UPDATE_SQL);
|
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.3.2", SCHEMA_UPDATE_SQL);
|
||||||
loadSql(schemaUpdateFile, conn);
|
loadSql(schemaUpdateFile, conn);
|
||||||
try {
|
try {
|
||||||
conn.createStatement().execute("insert into entity_alarm(tenant_id, entity_id, created_time, type, customer_id, alarm_id)" +
|
conn.createStatement().execute("insert into entity_alarm(tenant_id, entity_id, created_time, alarm_type, customer_id, alarm_id)" +
|
||||||
" select tenant_id, originator_id, created_time, type, customer_id, id from alarm;");
|
" select tenant_id, originator_id, created_time, type, customer_id, id from alarm;");
|
||||||
conn.createStatement().execute("insert into entity_alarm(tenant_id, entity_id, created_time, type, customer_id, alarm_id)" +
|
conn.createStatement().execute("insert into entity_alarm(tenant_id, entity_id, created_time, alarm_type, customer_id, alarm_id)" +
|
||||||
" select a.tenant_id, r.from_id, created_time, type, customer_id, id" +
|
" select a.tenant_id, r.from_id, created_time, type, customer_id, id" +
|
||||||
" from alarm a inner join relation r on r.relation_type_group = 'ALARM' and r.relation_type = 'ANY' and a.id = r.to_id ON CONFLICT DO NOTHING;");
|
" from alarm a inner join relation r on r.relation_type_group = 'ALARM' and r.relation_type = 'ANY' and a.id = r.to_id ON CONFLICT DO NOTHING;");
|
||||||
conn.createStatement().execute("delete from relation r where r.relation_type_group = 'ALARM';");
|
conn.createStatement().execute("delete from relation r where r.relation_type_group = 'ALARM';");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user