Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+332
View File
@@ -0,0 +1,332 @@
#
# $Id$
# $HeadURL$
# $Author$
# Created by Iuliana Ojog, 2021-02-10
#
SET(SRCS
db_update.cpp
db_update.h
logger.cpp
logger.h
global_updates_model.cpp
global_updates_model.h
exercises_model.cpp
exercises_model.h
show_history.cpp
show_history.h
history_model.cpp
history_model.h
main.cpp
)
SET(UPDATES
updates/1.00_create_db_version_tables.upd
updates/2.00_create_user_ets_ex_00.upd
updates/2.40_create_user_flt.upd
# updates/samples/1.01_sample_pdm_translation.upd
# updates/samples/1.02_sample_grant_create.upd
# updates/samples/1.03_sample_ex_rep.upd
# updates/samples/1.04_sample_flm_foreign_key.upd
# updates/samples/1.05_sample_asm_maps_bremen.upd
)
SET(UPDATES_AHTC
updates/ahtc/1.01_ahtc_ex_rec_equipment_state.upd
updates/ahtc/1.02_ahtc_pdm_vulnerability_kind.upd
updates/ahtc/1.03_ahtc_ex_aes.upd
updates/ahtc/1.04_ahtc_opm_rights_description.upd
updates/ahtc/1.05_ahtc_ism_mpa_barcodes.upd
updates/ahtc/1.06_ahtc_ex_sanitation_unique_id.upd
updates/ahtc/1.07_ahtc_pdm_building_charge_effect.upd
updates/ahtc/1.08_ahtc_pdm_sanitation_procedures.upd
updates/ahtc/1.09_ahtc_ex_rec_hitline_info.upd
updates/ahtc/1.10_ahtc_pdm_charge_type_2035.upd
updates/ahtc/1.11_ahtc_role_ctc_sv.upd
updates/ahtc/1.12_ahtc_ism_mpa_name.upd
updates/ahtc/1.13_ahtc_asm_egcu_relay_info.upd
updates/ahtc/1.14_ahtc_ex_bld_egcu_relay_infos.upd
updates/ahtc/1.15_ahtc_asm_egcu_relay_info_values.upd
updates/ahtc/1.16_ahtc_pdm_changes.upd
updates/ahtc/1.17_ahtc_opm_rights_egcu.upd
updates/ahtc/1.18_ahtc_pdm_dis_entity.upd
updates/ahtc/1.19_ahtc_pdm_gear_type.upd
updates/ahtc/1.20_ahtc_ex_eem_event_index.upd
updates/ahtc/1.21_ahtc_ism_and_ex_bld_bridge.upd
updates/ahtc/1.22_ahtc_ism_resource_management.upd
updates/ahtc/1.23_ahtc_ism_bridges.upd
updates/ahtc/1.24_ahtc_pdm_puma_vba.upd
updates/ahtc/1.25_ahtc_pdm_dis_entities_all.upd
updates/ahtc/1.26_ahtc_ism_assets.upd
updates/ahtc/1.27_ahtc_asm_egcu_relay_info_values.upd
updates/ahtc/1.28_ahtc_pdm_gear_type_charge_type.upd
updates/ahtc/1.29_ahtc_ism_building_names.upd
updates/ahtc/1.30_ahtc_ism_ips.upd
updates/ahtc/1.31_ahtc_flm_clean.upd
updates/ahtc/1.32_ahtc_flm_folders_ex_130.upd
updates/ahtc/1.33_ahtc_pdm_gear_type_charge_type_385.upd
updates/ahtc/1.34_ahtc_ex_clean_eem.upd
updates/ahtc/1.35_ahtc_ex_sanitation_qualification.upd
updates/ahtc/1.36_ahtc_pdm_building_charge_effect.upd
updates/ahtc/1.37_ahtc_ppm_equipment_type.upd
updates/ahtc/1.38_ahtc_ex_impact_position.upd
updates/ahtc/1.39_ahtc_ppm_properties.upd
updates/ahtc/1.40_ahtc_exm_sequence.upd
updates/ahtc/1.41_ahtc_asm_workstations.upd
updates/ahtc/1.42_ahtc_pdm_charge_type.upd
)
SET(UPDATES_GUEZ
updates/guez/1.01_guez_ex_rec_equipment_state.upd
updates/guez/1.02_guez_pdm_vulnerability_kind.upd
updates/guez/1.03_guez_ex_aes.upd
updates/guez/1.04_guez_opm_rights_description.upd
updates/guez/1.05_guez_ism_mpa_barcodes.upd
updates/guez/1.06_guez_ex_sanitation_unique_id.upd
updates/guez/1.07_guez_pdm_building_charge_effect.upd
updates/guez/1.08_guez_pdm_sanitation_procedures.upd
updates/guez/1.09_guez_ex_rec_hitline_info.upd
updates/guez/1.10_guez_pdm_charge_type_2035.upd
updates/guez/1.11_guez_role_ctc_sv.upd
updates/guez/1.12_guez_ism_mpa_name.upd
updates/guez/1.13_guez_asm_egcu_relay_info.upd
updates/guez/1.14_guez_ex_bld_egcu_relay_infos.upd
updates/guez/1.15_guez_asm_egcu_relay_info_values.upd
updates/guez/1.16_guez_pdm_changes.upd
updates/guez/1.17_guez_opm_rights_egcu.upd
updates/guez/1.18_guez_pdm_dis_entity.upd
updates/guez/1.19_guez_pdm_gear_type.upd
updates/guez/1.20_guez_ex_eem_event_index.upd
updates/guez/1.21_guez_ism_and_ex_bld_bridge.upd
updates/guez/1.22_guez_ism_resource_management.upd
updates/guez/1.23_guez_ism_bridges.upd
updates/guez/1.24_guez_pdm_puma_vba.upd
updates/guez/1.25_guez_pdm_dis_entities_all.upd
updates/guez/1.26_guez_ism_assets.upd
updates/guez/1.27_guez_asm_egcu_relay_info_values.upd
updates/guez/1.28_guez_pdm_gear_type_charge_type.upd
updates/guez/1.29_guez_ism_building_names.upd
updates/guez/1.30_guez_ism_ips.upd
updates/guez/1.31_guez_flm_clean.upd
updates/guez/1.32_guez_flm_folders_ex_130.upd
updates/guez/1.33_guez_pdm_gear_type_charge_type_385.upd
updates/guez/1.34_guez_ex_clean_eem.upd
updates/guez/1.35_guez_ex_sanitation_qualification.upd
updates/guez/1.36_guez_pdm_building_charge_effect.upd
updates/guez/1.37_guez_ppm_equipment_type.upd
#updates/guez/1.38_guez_ex_impact_position.upd
#updates/guez/1.39_guez_ppm_properties.upd
updates/guez/1.40_guez_exm_set_transferred.upd
updates/guez/1.41_guez_ex_clean_eem_set_unique_key.upd
#updates/guez/1.42_guez_pdm_building_charge_effect.upd
updates/guez/1.43_guez_ex_rep_treatment_vitality.upd
updates/guez/2.01_guez_rep_event_type.upd
updates/guez/2.02_guez_ex_nlos_tables.upd
updates/guez/2.03_guez_pdm_gear_type_properties.upd
updates/guez/2.10_guez_ex_ppm_dynamic_data_originator.upd
updates/guez/2.11_guez_ex_rep_pvsan.upd
updates/guez/2.12_guez_opm_san_nineliner_rights.upd
updates/guez/2.13_guez_aes_function_areas.upd
updates/guez/2.14_guez_ex_bld_history_state.upd
updates/guez/2.17_guez_aes_function_areas.upd
updates/guez/2.16_guez_flm_folders_ex_158.upd
updates/guez/2.19_guez_flm_new_structure.upd
updates/guez/2.20_guez_ism_structure_element.upd
updates/guez/2.21_guez_pdm_PzAbwVMiV.upd
updates/guez/2.23_guez_flm_delete_old_structure.upd
updates/guez/2.24_guez_flm_change_order.upd
updates/guez/2.26_guez_ism_schedule_status.upd
updates/guez/2.27_guez_flt_building_component_settings.upd
# updates/guez/2.31_guez_ism_view_schedules.upd
# updates/guez/2.32_guez_asm_schnoeggersburg_drone_topo2022.upd
updates/guez/2.33_guez_ism_remove_buildingnetworkswitch.upd
updates/guez/2.35_guez_ism_add_sections.upd
updates/guez/2.36_guez_ism_change_radio_basestation.upd
updates/guez/2.38_guez_opm_rights_resource_mgmt.upd
updates/guez/2.39_guez_delete_mounting_point_type_entries.upd
updates/guez/2.42_guez_ism_unique_key.upd
updates/guez/2.43_guez_avm_avs_events_last_update.upd
updates/guez/2.44_guez_ism_update_ips.upd
updates/guez/2.45_guez_alm_emergency_call.upd
updates/guez/2.46_guez_opm_rights_emergency_call.upd
updates/guez/2.47_guez_pdm_gear_type_update.upd
updates/guez/2.48_guez_pdm_charge_type_set_lrf_ltd.upd
updates/guez/2.49_guez_pdm_gear_type_single_mine_virtual.upd
updates/guez/2.50_guez_aes_update_entity.upd
updates/guez/2.51_guez_opm_rights_mine_single_virtual.upd
updates/guez/2.52_guez_ex_rec_international_mode.upd
updates/guez/2.53_ism_special_area.upd
updates/guez/2.54_ppm_silhouette.upd
updates/guez/2.55_aes_explosion_single.upd
updates/guez/2.56_guez_pdm_charge_type.upd
updates/guez/2.57_guez_ism_special_area.upd
updates/guez/2.58_guez_pdm_type.upd
updates/guez/2.59_guez_avm_update.upd
updates/guez/2.60_guez_aes_functional_area.upd
updates/guez/2.61_guez_pdm_charge_type_240.upd
updates/guez/2.62_guez_avm.upd
updates/guez/2.62_guez_pdm_charge_types_from_minelayer.upd
updates/guez/2.63_guez_avm_frequency_planning_status.upd
updates/guez/2.64_guez_aes_functional_area.upd
updates/guez/2.65_aes_mine_area_segment.upd
updates/guez/2.66_guez_aes_functional_area_translation.upd
updates/guez/2.67_guez_pdm_fire_purposes.upd
updates/guez/2.68_guez_aes_explosion_cluster.upd
updates/guez/2.69_guez_pdm_charge_type.upd
updates/guez/2.70_guez_ism_asset.upd
updates/guez/2.71_pdm_event_type.upd
updates/guez/2.72_bremen_ppm_template_type.upd
updates/guez/2.73_guez_pdm_translation.upd
updates/guez/2.74_guez_avm_tvc_channel.upd
updates/guez/2.75_restore_radio_readiness.upd
updates/guez/2.76_guez_opm_operators.upd
updates/guez/2.77_guez_b_c_contamination.upd
updates/guez/2.78_guez_ex_recording_tables.upd
updates/guez/2.79_guez_ex_aes_danger_area.upd
updates/guez/2.80_guez_avm_restore_heidebote-s.upd
updates/guez/2.81_guez_pdm_gear_type_rocket.upd
updates/guez/2.82_guez_ism_footprint.upd
updates/guez/2.83_guez_pdm_charge_type.upd
updates/guez/2.84_guez_pdm_building_charge.upd
updates/guez/2.85_guez_opm_operator_right.upd
updates/guez/2.86_guez_ex_recording_tables.upd
updates/guez/2.87_guez_aes_explosion_cluster.upd
updates/guez/2.88_guez_pdm_charge_type_set_laserGuidable.upd
updates/guez/2.89_guez_pdm_charge_type.upd
updates/guez/2.90_guez_aes_weather.upd
updates/guez/2.91_guez_pdm_charge_type.upd
updates/guez/2.92_aes_explosion_cluster.upd
updates/guez/2.93_guez_rep_treatment.upd
updates/guez/2.94_guez_ism_asset_thales_test_components.upd
updates/guez/2.95_guez_pdm_charge_type_pzabwmiv.upd
updates/guez/2.96_guez_pdm_LTD.upd
updates/guez/2.97_guez_rename_user.upd
updates/guez/2.98_guez_aes_static_weather.upd
updates/guez/2.99_guez_pdm_show_LTD_hitline.upd
updates/guez/2.100_guez_pdm_charge_type.upd
updates/guez/2.101_guez_opm_groups.upd
updates/guez/2.102_guez_pdm_fuse_type_factor.upd
updates/guez/2.103_guez_exm_properties.upd
updates/guez/2.104_guez_ism_structure_element.upd
updates/guez/2.105_guez_pdm_charge_type.upd
updates/guez/2.106_guez_rep_airsupport.upd
updates/guez/2.107_guez_pdm_event_type.upd
updates/guez/2.108_guez_pdm_VLAD.upd
updates/guez/2.109_guez_ppm.upd
updates/guez/2.110_guez_pdm_ADLER_munition.upd
updates/guez/2.111_guez_ppm_UAS_type.upd
updates/guez/2.112_guez_permission_uas.upd
updates/guez/2.113_guez_pdm_air_support.upd
updates/guez/2.119_guez_nom_schema.upd
updates/guez/2.120_guez_nom_notification.upd
updates/guez/2.121_guez_ppm_party.upd
updates/guez/2.125_guez_pdm_charge_type.upd
updates/guez/2.126_guez_pdm_saa_tables.upd
updates/guez/2.127_guez_ppm_types_adler.upd
updates/guez/2.128_guez_aes_entity_received.upd
updates/guez/2.130_guez_opm_operator_rights.upd
updates/guez/2.134_guez_opm_operator_rights.upd
updates/guez/2.136_opm_operator_exercise.upd
updates/guez/2.135_guez_asm_asset_saa.upd
updates/guez/2.136_opm_operator_exercise.upd
updates/guez/2.138_guez_pdm_effect_source.upd
updates/guez/2.139_guez_aes_effect_source.upd
updates/guez/2.142_guez_flm_is_hidden.upd
updates/guez/2.145_guez_esm_vehicle_status.upd
updates/guez/2.146_guez_aes_explosion_cluster.upd
updates/guez/2.135_guez_asm_asset_saa.upd
updates/guez/2.123_guez_pdm_charge_type.upd
updates/guez/2.124_guez_ppm_mission.upd
updates/guez/2.122_guez_pdm_uas_charge_Type.upd
updates/guez/2.132_guez_opm_operator_rights.upd
updates/guez/2.137_guez_pdm_fire_purpose.upd
updates/guez/2.140_guez_ppm_rec_nbcprotection.upd
updates/guez/2.141_guez_aes_charge_effect.upd
updates/guez/2.144_guez_pdm_charge_type.upd
updates/guez/2.147_guez_pdm_translations.upd
updates/guez/2.148_guez_flm_file_type.upd
updates/guez/2.149_guez_ppm_type.upd
updates/guez/2.150_guez_pdm_changes.upd
updates/guez/2.151_guez_pdm_igniter_changes.upd
updates/guez/2.152_guez_asm_asset_add_saaList.upd
updates/guez/2.153_guez_aes_igniter_changes.upd
updates/guez/2.154_guez_pdm_charges.upd
updates/guez/2.155_guez_pdm_uas.upd
updates/guez/2.156_guez_opm_operator_exercise.upd
updates/guez/2.157_guez_aes_effect_cluster.upd
updates/guez/2.158_guez_aes_recording_tables.upd
updates/guez/2.159_guez_pdm_fire_purpose.upd
updates/guez/2.160_guez_opm_operator_rights.upd
updates/guez/2.161_guez_pdm_gear_type.upd
updates/guez/2.162_guez_aes_effect_cluster.upd
updates/guez/2.163_guez_pdm_load_type.upd
updates/guez/2.164_guez_aes_mine_area_triggered_mines.upd
updates/guez/2.165_guez_ppm_type.upd
updates/guez/2.166_guez_ppm_charge_type_mine_class.upd
updates/guez/2.167_guez_ppm_type_rework.upd
updates/guez/2.168_pdm_add_cadence.upd
updates/guez/2.169_guez_ppm_impact_radius.upd
updates/guez/2.170_guez_nom_notification.upd
updates/guez/2.171_add_uas_ied_into_charge_type_igniter_type.upd
updates/guez/2.172_guez_laser_munition_as_he_munition.upd
updates/guez/2.173_guez_pdm_effect_source_unknown.upd
updates/guez/2.174_rep_report_effect_source.upd
updates/guez/2.175_pdm_charge_type_igniter.upd
updates/guez/2.177_guez_DM72_update_charge_type_properties.upd
updates/guez/2.178_guez_pdm_target_type_target_subtype.upd
updates/guez/2.179_guez_ppm_uas_update.upd
updates/guez/2.180_guez_ex_rec_uas.upd
)
SET(UPDATES_QATAR
updates/qatar/1.01_qatar_charge.upd
)
SET(UPDATES_QATARMOUT
updates/qatar/1.01_qatar_charge.upd
)
NGL_WRAP_UI(SRCS ui/db_update.ui ui/show_history.ui)
NGL_ADD_EXECUTABLE(SV dbUpdate ${SRCS})
NGL_TARGET_LINK_LIBRARIES(dbUpdate
Qt5::Widgets
Qt5::Core
nglapplication
ngldb
nglcoreapplication
ngltools
ngltranslator
nglwidgets
nglsettings
NGLLogger
LtsCommandLineParser
)
NGL_INSTALL_TARGET(dbUpdate)
NGL_INSTALL(SV FILES log4cxx_dbu.props DESTINATION bin)
NGL_INSTALL(SV FILES ${UPDATES} DESTINATION bin/updates)
IF(GUEZ_MODE)
NGL_INSTALL(SV FILES ${UPDATES_GUEZ} DESTINATION bin/updates)
ELSE()
IF( DEFINED _pname)
IF(UNIX AND "${_pname}" STREQUAL "qatarmout")
MESSAGE("Install updates for QATAR MOUT")
NGL_INSTALL(SV FILES ${UPDATES_QATARMOUT} DESTINATION bin/updates)
ELSEIF(UNIX AND "${_pname}" STREQUAL "qatar")
MESSAGE("Install updates for QATAR")
NGL_INSTALL(SV FILES ${UPDATES_QATAR} DESTINATION bin/updates)
ELSE()
NGL_INSTALL(SV FILES ${UPDATES_AHTC} DESTINATION bin/updates)
ENDIF()
ENDIF()
ENDIF()
+919
View File
@@ -0,0 +1,919 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#include "db_update.h"
#include "ui_db_update.h"
#include "show_history.h"
#include <ngldb/dbconnection.h>
#include <ngldb/dbtransaction.h>
#include <ngldb/nsqlquery.h>
#include <nglsettings/nglsettings_settings.h>
#include <ngltools/ngltools_filesystem.h>
#include <QMessageBox>
#include <QDateTime>
#include <QDir>
#include <QFileDialog>
#include <QSqlError>
namespace DBUpdate
{
QString DBUpdate::m_defaultPath = QDir::homePath() + QStringLiteral("/bin/updates/");
DBUpdate::DBUpdate(QWidget *parent)
: QMainWindow(parent)
, m_ui(new Ui::DBUpdate)
, m_showHistory(new ShowHistory)
, m_logger(getLogger("DBUpdate"))
{
m_ui->setupUi(this);
setWindowTitle(QLatin1String("Database Update"));
m_globalUpdatesModel = new GlobalUpdatesModel(this);
m_globalUpdatesProxyModel = new GlobalUpdatesProxyModel(this);
m_globalUpdatesProxyModel->setSourceModel(m_globalUpdatesModel);
m_ui->tvGlobalUpdates->setModel(m_globalUpdatesProxyModel);
connect(m_ui->tvGlobalUpdates, &QTableView::doubleClicked, this, &DBUpdate::onShowGlobalHistory);
m_exercisesModel = new ExercisesModel(this);
m_exercisesProxyModel = new ExercisesProxyModel(this);
m_exercisesProxyModel->setSourceModel(m_exercisesModel);
m_ui->tvExerciseUpdates->setModel(m_exercisesProxyModel);
connect(m_ui->tvExerciseUpdates, &QTableView::doubleClicked, this, &DBUpdate::onShowExerciseHistory);
connect(m_ui->tbClose, &QToolButton::clicked, this, &DBUpdate::onClosedClicked);
connect(m_ui->tbLoadUpdate, &QToolButton::clicked, this, &DBUpdate::onUpdateLoad);
connect(m_ui->tbRunUpdate, &QToolButton::clicked, this, &DBUpdate::onUpdateRun);
connect(m_ui->tbShowLog, &QToolButton::clicked, this, &DBUpdate::onShowLogFile);
connect(m_ui->tbClearLog, &QToolButton::clicked, this, &DBUpdate::onClearLogFile);
connect(m_ui->tbLoadSQL, &QToolButton::clicked, this, &DBUpdate::onLoadSQL);
connect(m_ui->tbBackup, &QToolButton::clicked, this, &DBUpdate::onBackupDB);
m_ui->tvExerciseUpdates->hideColumn(ExercisesModel::Columns::Id);
m_ui->tvExerciseUpdates->hideColumn(ExercisesModel::Columns::StartTime);
m_ui->tvExerciseUpdates->hideColumn(ExercisesModel::Columns::EndTime);
//m_ui->tvExerciseUpdates->hideColumn(ExercisesModel::Columns::StateId);
enaDisa();
}
DBUpdate::~DBUpdate()
{
delete m_showHistory;
delete m_globalUpdatesModel;
delete m_globalUpdatesProxyModel;
delete m_exercisesModel;
delete m_exercisesProxyModel;
delete m_ui;
}
bool DBUpdate::init()
{
QString str;
NGL::Settings s(str);
// open postgres db, read table structure, read static data
const QString dbUser(QStringLiteral("postgres"));
const QString dbPasswd(QStringLiteral("postgres"));
m_db = DBConnection::open(m_logger,
dbUser,
dbPasswd,
s.databaseDriver(),
s.databaseHostname(),
s.databaseName());
if (!m_db.isOpen())
return false;
m_ui->lblDbConnection->setText(m_db.hostName() + QStringLiteral(" / ") + m_db.databaseName());
enaDisa();
return true;
}
void DBUpdate::onClosedClicked()
{
close();
}
void DBUpdate::onUpdateLoad()
{
DEBUG_LOG(m_logger) << "onUpdateLoad";
// open dialog
const QStringList filter(
{
tr("Update Files (*.upd)"),
#ifdef Q_OS_WIN
tr("All (*.*)")
#else
tr("All (*)")
#endif
});
QString fileName = QFileDialog::getOpenFileName(this,
tr("Load database update file"),
m_defaultPath,
filter.join(QStringLiteral(";;")));
if (fileName.isEmpty())
return;
QFileInfo fileInfo(fileName);
if (!fileInfo.isReadable())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while loading the file.\n"
"The loaded file is not readable."));
return;
}
m_defaultPath = fileInfo.path() + QLatin1Char('/');
m_update.filename = fileName;
if (parseUpdateFile(fileName))
{
m_globalUpdatesModel->initModel(m_db, m_update.version, m_update.global_schemas.split(QStringLiteral(",")));
m_exercisesModel->initModel(m_db, m_update.version, m_update.exercise_schemas.split(QStringLiteral(",")));
m_ui->tbRunUpdate->setEnabled(true);
}
else
ERROR_LOG(m_logger) << "Not a valid update file " << fileName;
}
void DBUpdate::onUpdateRun()
{
QStringList gSchemas = m_globalUpdatesModel->getSchemasToUpdate();
QStringList eSchemas = m_exercisesModel->getSchemasToUpdate();
// generate SQL
m_sql.clear();
if (m_update.global_sql.size() > 0 && gSchemas.size() > 0)
{
for (auto &gs : gSchemas)
{
m_sql += QStringLiteral("--BEGIN;\n");
if (gs != QStringLiteral("PUBLIC"))
{
QString sUser = QStringLiteral("ets_") + gs;
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT SELECT, REFERENCES ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT EXECUTE ON FUNCTIONS TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT ALL ON SEQUENCES TO ") + sUser + QStringLiteral(";\n");
}
m_sql += QStringLiteral("SET SEARCH_PATH TO %1;\n").arg(gs);
m_sql += m_update.global_sql;
m_sql += QStringLiteral("\n");
m_sql += QStringLiteral("INSERT INTO db_version (description, version) VALUES ('%1', '%2');\n\n").arg(m_update.info, m_update.version);
m_sql += QStringLiteral("\n--COMMIT;\n\n");
}
}
if (m_update.exercise_sql.size() > 0 && eSchemas.size() > 0)
{
for (auto &es : eSchemas)
{
m_sql += QStringLiteral("--BEGIN;\n");
QString sUser = QStringLiteral("ets_ex_00"); // + es;
m_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
m_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
m_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
// backwards compatibility
QString sOldUser = QStringLiteral("ets_") + es;
m_sql += QStringLiteral("SELECT public.revoke_user_if_exists('%1','%2');\n").arg(sOldUser).arg(es);
/*
m_sql += QStringLiteral("SELECT create_user_if_not_exists('%1');\n").arg(sOldUser);
m_sql += QStringLiteral("REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %1 FROM %2 CASCADE;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %1 FROM %2 CASCADE;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON TABLES FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON TABLES FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON FUNCTIONS FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON FUNCTIONS FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON SEQUENCES FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON SEQUENCES FROM %2;\n").arg(es).arg(sOldUser);
m_sql += QStringLiteral("DROP USER %1;\n").arg(sOldUser);
*/
// backwards compatibility
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT SELECT, REFERENCES ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT EXECUTE ON FUNCTIONS TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT ALL ON SEQUENCES TO ") + sUser + QStringLiteral(";\n");
m_sql += QStringLiteral("SET SEARCH_PATH TO %1;\n").arg(es);
m_sql += m_update.exercise_sql;
m_sql += QStringLiteral("\n");
m_sql += QStringLiteral("INSERT INTO db_version (description, version) VALUES ('%1', '%2');\n\n").arg(m_update.info, m_update.version);
m_sql += QStringLiteral("\n--COMMIT;\n\n");
}
}
if (m_sql.size() > 0)
{
saveUpdateSql();
DBTransaction transaction(m_db);
NSqlQuery q(m_db);
transaction.begin();
if (!q.exec(m_sql))
{
DEBUG_LOG(m_logger) << "Failed sql: " << m_sql;
ERROR_LOG(m_logger) << "Error running sql: " << q.lastError().databaseText() << " " << q.lastError().driverText();
transaction.rollback();
if (m_showUi)
QMessageBox::warning(this, tr("Error!"), tr("An error occurred executing sql. See log file for details."));
}
else
{
transaction.commit();
if (transaction.state())
{
DEBUG_LOG(m_logger) << "SUCCESS running update: " << m_update.filename;
if (m_showUi)
QMessageBox::information(this, tr("Success"), tr("Update successful!"));
}
else
{
transaction.rollback();
if (m_showUi)
QMessageBox::warning(this, tr("Error!"), tr("An error occurred executing sql. See log file for details."));
}
}
}
else
if (m_showUi)
QMessageBox::warning(this, tr("Warning"), tr("Nothing to update."));
if (m_showUi)
enaDisa();
}
void DBUpdate::saveUpdateSql()
{
QString sqlFile = DBUpdate::m_defaultPath + m_update.version;
if (m_update.project.size() > 0)
sqlFile += QStringLiteral("_") + m_update.project;
sqlFile += QStringLiteral("_run.sql");
QFile file(sqlFile);
if (!file.open(QIODevice::WriteOnly | QFile::Truncate))
{
ERROR_LOG(m_logger) << "Error opening file '" << file.fileName() << "' for writing: "
<< file.errorString();
return ;
}
file.write(m_sql.toUtf8());
file.write("\n");
file.close();
INFO_LOG(m_logger) << "Saved GENERATED UPDATE FILE: " << sqlFile;
return;
}
void DBUpdate::onBackupDB()
{
INFO_LOG(m_logger) << "Creating DB Backup";
const QString& gVers = m_globalUpdatesModel->getLastUpdate();
const QString& eVers = m_exercisesModel->getLastUpdate();
QString currVersion = ( gVers >= eVers ? gVers : eVers );
QString date = QDate::currentDate().toString(QLatin1String("yyyyMMdd"));
QString dumpFile = DBUpdate::m_defaultPath + m_db.hostName() + QLatin1Char('_') +
m_db.databaseName()+ QLatin1Char('_') + date + QLatin1Char('_') + currVersion + QStringLiteral(".dump");
DBUpdateRun *dbRun = new DBUpdateRun(QString(), false, true);
bool backupOK = dbRun->runPgDump(dumpFile, m_db.hostName(), m_db.databaseName());
if (!backupOK)
{
ERROR_LOG(m_logger) << "Backup failed";
QMessageBox::critical(this, tr("Backup"), tr("Backup failed!"), QMessageBox::Ok);
}
else
{
INFO_LOG(m_logger) << "Created DB Backup successfully: " << dumpFile;
QMessageBox::information(this, tr("Backup"), tr("Successfully created DB backup: %1").arg(dumpFile), QMessageBox::Ok);
}
delete dbRun;
}
void DBUpdate::enaDisa()
{
if (!m_ui)
return;
// reset UI
m_globalUpdatesModel->initModel(m_db);
m_exercisesModel->initModel(m_db);
m_ui->tbRunUpdate->setEnabled(false);
m_ui->lblSelectedUpdate->setText(tr("(no update loaded)"));
m_ui->teHeader->clear();
m_ui->lblSQL->clear();
m_ui->pteSQL->clear();
m_ui->tvExerciseUpdates->resizeColumnsToContents();
m_ui->tvGlobalUpdates->resizeColumnsToContents();
const QString& gVers = m_globalUpdatesModel->getLastUpdate();
const QString& eVers = m_exercisesModel->getLastUpdate();
int upperGVersion = gVers.split(QLatin1Char('.')).at(0).toInt();
int gVersion = gVers.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "gVersion: " << gVersion;
DEBUG_LOG(m_logger) << "upperGVersion: " << upperGVersion;
int upperEVersion = eVers.split(QLatin1Char('.')).at(0).toInt();
int eVersion = eVers.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "eVersion: " << eVersion;
DEBUG_LOG(m_logger) << "upperEVersion: " << upperEVersion;
QString currVersion = eVers;
if ( upperGVersion > upperEVersion )
currVersion = gVers;
else if ( upperGVersion == upperEVersion )
currVersion = (gVersion >= eVersion ? gVers : eVers );
m_ui->lblVersion->setText(currVersion);
}
void DBUpdate::onShowLogFile()
{
QString logFile = NGL::Settings::logPath() + QStringLiteral("/") + QString::fromLatin1(qgetenv("USER")) + QStringLiteral("_dbu.log");
DEBUG_LOG(m_logger) << "onShowLogFile(): " << logFile;
QFile file(logFile);
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG(m_logger) << "Cannot open file " << logFile;
return ;
}
QByteArray output = file.readAll();
m_ui->pteLogFile->clear();
m_ui->pteLogFile->setPlainText(QString::fromLocal8Bit(output));
file.close();
return;
}
void DBUpdate::onClearLogFile()
{
QString logFile = NGL::Settings::logPath() + QStringLiteral("/") + QString::fromLatin1(qgetenv("USER")) + QStringLiteral("_dbu.log");
DEBUG_LOG(m_logger) << "onClearLogFile(): " << logFile;
QFile file(logFile);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QFile::Truncate))
{
ERROR_LOG(m_logger) << "Cannot clear file " << logFile;
return ;
}
file.close();
m_ui->pteLogFile->clear();
return;
}
bool DBUpdate::parseUpdateFile(const QString &fileName, bool showUi)
{
DEBUG_LOG(m_logger) << "parseUpdateFile: " << fileName;
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG(m_logger) << "Cannot read file " << fileName;
return false;
}
QByteArray fileContent = file.readAll();
QString updateFile = QString::fromLocal8Bit(fileContent);
QStringList strUpdate;
bool fileOk = true;
static const QRegularExpression re_info(QStringLiteral("INFO: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_date(QStringLiteral("DATE: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_vers(QStringLiteral("VERSION: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_proj(QStringLiteral("PROJECT: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_glob(QStringLiteral("GLOBAL: (.+?);.(.+?COMMIT;)"), QRegularExpression::DotMatchesEverythingOption);
static const QRegularExpression re_exer(QStringLiteral("EXERCISE: (.+?);.(.+?COMMIT;)"), QRegularExpression::DotMatchesEverythingOption);
QRegularExpressionMatch match_info = re_info.match(updateFile);
QRegularExpressionMatch match_proj = re_proj.match(updateFile);
QRegularExpressionMatch match_vers = re_vers.match(updateFile);
QRegularExpressionMatch match_date = re_date.match(updateFile);
QRegularExpressionMatch match_glob = re_glob.match(updateFile);
QRegularExpressionMatch match_exer = re_exer.match(updateFile);
if (match_info.hasMatch() && match_vers.hasMatch() && match_glob.hasMatch() && match_exer.hasMatch())
// these are mandatory for a valid update file
{
strUpdate += match_info.captured(0);
strUpdate += match_vers.captured(0);
if (match_date.hasMatch())
{
strUpdate += match_date.captured(0);
m_update.date = match_date.captured(1);
}
if (match_proj.hasMatch())
{
strUpdate += match_proj.captured(0);
m_update.project = match_proj.captured(1).toLower();
}
strUpdate += QStringLiteral("GLOBAL: ") + match_glob.captured(1);
strUpdate += QStringLiteral("EXERCISE: ") + match_exer.captured(1);
m_update.info = match_info.captured(1);
m_update.version = match_vers.captured(1);
ERROR_LOG(m_logger) << "Update version: " << m_update.version;
m_update.global_schemas = match_glob.captured(1);
m_update.global_sql = match_glob.captured(2);
m_update.exercise_schemas = match_exer.captured(1);
m_update.exercise_sql = match_exer.captured(2);
m_update.global_sql.remove(QStringLiteral("BEGIN;"));
m_update.global_sql.remove(QStringLiteral("COMMIT;"));
m_update.exercise_sql.remove(QStringLiteral("BEGIN;"));
m_update.exercise_sql.remove(QStringLiteral("COMMIT;"));
}
else
{
fileOk = false;
}
if (fileOk && showUi)
{
m_ui->lblSelectedUpdate->setText(fileName);
m_ui->teHeader->clear();
m_ui->teHeader->setText(strUpdate.join(QStringLiteral("\n")));
DEBUG_LOG(m_logger) << " teHeader strUpdate: " << strUpdate.join(QStringLiteral("\n"));
}
file.close();
return fileOk;
}
void DBUpdate::onShowGlobalHistory(const QModelIndex &idx)
{
DEBUG_LOG(m_logger) << "onShowHistory";
QModelIndex realIdx = m_globalUpdatesProxyModel->mapToSource(idx);
const QString &schema = m_globalUpdatesModel->getRowData(realIdx.row()).schema;
DEBUG_LOG(m_logger) << "Schema = " << schema;
if (m_showHistory->init(m_db, schema))
m_showHistory->show();
}
void DBUpdate::onShowExerciseHistory(const QModelIndex &idx)
{
DEBUG_LOG(m_logger) << "onShowHistory";
QModelIndex realIdx = m_exercisesProxyModel->mapToSource(idx);
const QString &schema = m_exercisesModel->getRowData(realIdx.row()).schema;
DEBUG_LOG(m_logger) << "Schema = " << schema;
if (m_showHistory->init(m_db, schema))
m_showHistory->show();
}
void DBUpdate::onLoadSQL()
{
DEBUG_LOG(m_logger) << "onLoadSQL";
// open dialog
const QStringList filter(
{
tr("Update Files (*.sql)"),
#ifdef Q_OS_WIN
tr("All (*.*)")
#else
tr("All (*)")
#endif
});
QString fileName = QFileDialog::getOpenFileName(this,
tr("Load sql file"),
m_defaultPath,
filter.join(QStringLiteral(";;")));
if (fileName.isEmpty())
return;
QFileInfo fileInfo(fileName);
if (!fileInfo.isReadable())
{
QMessageBox::warning(this, tr("Error!"), tr("An error occurred while loading the file.\n"
"The loaded file is not readable."));
return;
}
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG(m_logger) << "Cannot open file " << fileName;
return ;
}
QByteArray output = file.readAll();
m_ui->lblSQL->setText(fileName);
m_ui->pteSQL->clear();
m_ui->pteSQL->setPlainText(QString::fromLocal8Bit(output));
file.close();
}
//===============================================================================================
DBUpdateRun::DBUpdateRun(const QString &updateFile, bool generateOnly, bool withBackup, QObject *parent)
: QObject(parent)
, m_generateOnly(generateOnly)
, m_withBackup(withBackup)
, m_globalUpdatesModel(new GlobalUpdatesModel(this))
, m_exercisesModel(new ExercisesModel(this))
, m_proc(nullptr)
, m_logger(getLogger("DBUpdate"))
{
m_update.filename = updateFile;
}
DBUpdateRun::~DBUpdateRun()
{
delete m_globalUpdatesModel;
delete m_exercisesModel;
}
bool DBUpdateRun::init()
{
QString str;
NGL::Settings s(str);
// open postgres db, read table structure, read static data
const QString dbUser(QStringLiteral("postgres"));
const QString dbPasswd(QStringLiteral("postgres"));
m_db = DBConnection::open(m_logger,
dbUser,
dbPasswd,
s.databaseDriver(),
s.databaseHostname(),
s.databaseName());
if (!m_db.isOpen())
return false;
DEBUG_LOG(m_logger) << "DB Open: " << s.databaseHostname() << " / " << s.databaseName();
m_globalUpdatesModel->initModel(m_db);
m_exercisesModel->initModel(m_db);
return true;
}
bool DBUpdateRun::runUpdate()
{
DEBUG_LOG(m_logger) << "runUpdate: " << m_update.filename;
bool bRet = false;
if (m_withBackup)
{
DEBUG_LOG(m_logger) << "Creating DB Backup ...";
const QString& gVers = m_globalUpdatesModel->getLastUpdate();
const QString& eVers = m_exercisesModel->getLastUpdate();
QString currVersion = ( gVers >= eVers ? gVers : eVers );
QString dumpFile = DBUpdate::m_defaultPath + m_db.hostName() + QLatin1Char('_') +
m_db.databaseName()+ QLatin1Char('_') + currVersion + QStringLiteral(".dump");
if (!runPgDump(dumpFile, m_db.hostName(), m_db.databaseName()))
ERROR_LOG(m_logger) << "DB Backup failed!!!";
}
if (parseUpdateFile())
{
DEBUG_LOG(m_logger) << "succesfully parsed update file:" << m_update.filename;
m_globalUpdatesModel->initModel(m_db, m_update.version, m_update.global_schemas.split(QStringLiteral(",")));
m_exercisesModel->initModel(m_db, m_update.version, m_update.exercise_schemas.split(QStringLiteral(",")));
generateSql();
if (m_update.generated_file.size() > 0)
bRet = true;
if (!m_generateOnly && bRet)
{
DEBUG_LOG(m_logger) << "Running sql file: " << m_update.generated_file;
bRet = runPsql();
}
}
return bRet;
}
bool DBUpdateRun::runPsql()
{
const QStringList args({QStringLiteral("-U"),
QStringLiteral("postgres"),
QStringLiteral("-f"),
m_update.generated_file,
QStringLiteral("-h"),
m_db.hostName(),
m_db.databaseName()});
handleProcInit(executablePath(QStringLiteral("psql")), args);
connect(m_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, &DBUpdateRun::onPsqlFinished);
m_proc->start();
return m_proc->waitForFinished();
}
bool DBUpdateRun::runPgDump(const QString& dumpFile, const QString& dbHost, const QString& dbName)
{
INFO_LOG(m_logger) << "Backup file = " << dumpFile;
const QStringList args(
{ QStringLiteral("--column-inserts"),
QStringLiteral("-U"), QStringLiteral("postgres"),
QStringLiteral("-f"), dumpFile,
QStringLiteral("-h"), dbHost, dbName});
handleProcInit(executablePath(QStringLiteral("pg_dump")), args);
connect(m_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, &DBUpdateRun::onPgDumpFinished);
m_proc->start();
return m_proc->waitForFinished();
}
QString DBUpdateRun::executablePath(const QString &program)
{
QString errStr;
const QString ret = NGL::postgresExecutablePath(program, errStr);
if (!errStr.isEmpty())
WARNING_LOG(m_logger) << errStr;
return ret;
}
void DBUpdateRun::handleProcInit(const QString &program, const QStringList &args)
{
if (m_proc)
{
m_proc->disconnect(this);
m_proc->deleteLater();
}
m_proc = new QProcess(this);
NOTICE_LOG(m_logger) << "Starting process '" << program << "' with args '" << args.join(QLatin1Char(' ')) << "'";
m_proc->setProgram(program);
m_proc->setArguments(args);
connect(m_proc, &QProcess::errorOccurred,
this, &DBUpdateRun::onErrorOccured);
}
void DBUpdateRun::handleProcFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
if (!m_proc)
return;
if (exitCode != 0 || exitStatus != 0)
{
QByteArray out = m_proc->readAllStandardError();
if (!out.isEmpty())
out += '\n';
out += m_proc->readAllStandardOutput();
ERROR_LOG(m_logger) << "Process finished - exitCode: " << exitCode << ", exitStatus = " << exitStatus << ", " << out;
}
m_proc->disconnect(this);
m_proc->deleteLater();
m_proc = nullptr;
}
void DBUpdateRun::onPsqlFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
NOTICE_LOG(m_logger) << "onPsqlFinished: exitCode: " << exitCode << ", exitStatus: " << exitStatus;
if (exitCode > 0)
{
ERROR_LOG(m_logger) << "Psql failed";
emit runSqlFailed();
return;
}
emit runSqlFinished();
}
void DBUpdateRun::onPgDumpFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
NOTICE_LOG(m_logger) << "onPgDumpFinished: exitCode: " << exitCode << ", exitStatus: " << exitStatus;
if (exitCode > 0)
{
ERROR_LOG(m_logger) << "Backup (pg_dump) failed";
emit runPgDumpFailed();
return;
}
ERROR_LOG(m_logger) << "Backup successfully finished!";
emit runPgDumpFinished();
}
void DBUpdateRun::onErrorOccured(QProcess::ProcessError error)
{
ERROR_LOG(m_logger) << "error: " << error << ", " << m_proc->readAllStandardOutput() << ", " << m_proc->readAllStandardError();
}
bool DBUpdateRun::parseUpdateFile()
{
DEBUG_LOG(m_logger) << "parseUpdateFile: " << m_update.filename;
QFile file(m_update.filename);
if (!file.open(QIODevice::ReadOnly))
{
ERROR_LOG(m_logger) << "Cannot read file " << m_update.filename;
return false;
}
QByteArray fileContent = file.readAll();
QString updateFile = QString::fromLocal8Bit(fileContent);
QStringList strUpdate;
bool fileOk = true;
static const QRegularExpression re_info(QStringLiteral("INFO: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_date(QStringLiteral("DATE: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_vers(QStringLiteral("VERSION: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_proj(QStringLiteral("PROJECT: (.*?)$"), QRegularExpression::MultilineOption);
static const QRegularExpression re_glob(QStringLiteral("GLOBAL: (.+?);.(.+?COMMIT;)"), QRegularExpression::DotMatchesEverythingOption);
static const QRegularExpression re_exer(QStringLiteral("EXERCISE: (.+?);.(.+?COMMIT;)"), QRegularExpression::DotMatchesEverythingOption);
QRegularExpressionMatch match_info = re_info.match(updateFile);
QRegularExpressionMatch match_vers = re_vers.match(updateFile);
QRegularExpressionMatch match_date = re_date.match(updateFile);
QRegularExpressionMatch match_glob = re_glob.match(updateFile);
QRegularExpressionMatch match_exer = re_exer.match(updateFile);
QRegularExpressionMatch match_proj = re_proj.match(updateFile);
if (match_info.hasMatch() && match_vers.hasMatch() && match_glob.hasMatch() && match_exer.hasMatch())
// these are mandatory for a valid update file
{
strUpdate += match_info.captured(0);
strUpdate += match_vers.captured(0);
if (match_date.hasMatch())
{
strUpdate += match_date.captured(0);
m_update.date = match_date.captured(1);
}
if (match_proj.hasMatch())
{
strUpdate += match_proj.captured(0);
m_update.project = match_proj.captured(1).toLower();
}
strUpdate += QStringLiteral("GLOBAL: ") + match_glob.captured(1);
strUpdate += QStringLiteral("EXERCISE: ") + match_exer.captured(1);
m_update.info = match_info.captured(1);
m_update.version = match_vers.captured(1);
m_update.global_schemas = match_glob.captured(1);
m_update.global_sql = match_glob.captured(2);
m_update.exercise_schemas = match_exer.captured(1);
m_update.exercise_sql = match_exer.captured(2);
m_update.global_sql.remove(QStringLiteral("BEGIN;"));
m_update.global_sql.remove(QStringLiteral("COMMIT;"));
m_update.exercise_sql.remove(QStringLiteral("BEGIN;"));
m_update.exercise_sql.remove(QStringLiteral("COMMIT;"));
}
else
{
fileOk = false;
}
file.close();
return fileOk;
}
void DBUpdateRun::generateSql()
{
DEBUG_LOG(m_logger) << "generateSql:";
QStringList gSchemas = m_globalUpdatesModel->getSchemasToUpdate();
QStringList eSchemas = m_exercisesModel->getSchemasToUpdate();
DEBUG_LOG(m_logger) << "Global schemas: " << gSchemas.join(QStringLiteral(","));
DEBUG_LOG(m_logger) << "Exercise schemas: " << gSchemas.join(QStringLiteral(","));
DEBUG_LOG(m_logger) << "Global sql: " << m_update.global_sql;
DEBUG_LOG(m_logger) << "Exercise sql: " << m_update.exercise_sql;
// generate SQL
m_update.generated_sql.clear();
if (m_update.global_sql.size() > 0 && gSchemas.size() > 0)
{
ERROR_LOG(m_logger) << "Global sql: " << m_update.global_sql;
for (auto &gs : gSchemas)
{
m_update.generated_sql += QStringLiteral("--BEGIN;\n");
if (gs != QStringLiteral("PUBLIC"))
{
QString sUser = QStringLiteral("ets_") + gs;
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT SELECT, REFERENCES ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT EXECUTE ON FUNCTIONS TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + gs + QStringLiteral(" GRANT ALL ON SEQUENCES TO ") + sUser + QStringLiteral(";\n");
}
}
m_update.generated_sql += QStringLiteral("SET SEARCH_PATH TO %1;\n").arg(gSchemas.join(QStringLiteral(",")));
m_update.generated_sql += m_update.global_sql;
m_update.generated_sql += QStringLiteral("\n");
m_update.generated_sql += QStringLiteral("INSERT INTO db_version (description, version) VALUES ('%1', '%2');\n\n").arg(m_update.info, m_update.version);
m_update.generated_sql += QStringLiteral("\n--COMMIT;\n\n");
}
if (m_update.exercise_sql.size() > 0 && eSchemas.size() > 0)
{
ERROR_LOG(m_logger) << "Exercise sql: " << m_update.exercise_sql;
for (auto &es : eSchemas)
{
m_update.generated_sql += QStringLiteral("--BEGIN;\n");
QString sUser = QStringLiteral("ets_ex_00"); // + es;
m_update.generated_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
m_update.generated_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
m_update.generated_sql += QStringLiteral("GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %1 TO %2;\n").arg(es).arg(sUser);
//backwards compatibility
QString sOldUser = QStringLiteral("ets_") + es;
m_update.generated_sql += QStringLiteral("SELECT public.revoke_user_if_exists('%1','%2');\n").arg(sOldUser).arg(es);
/*
m_update.generated_sql += QStringLiteral("SELECT create_user_if_not_exists('%1');\n").arg(sOldUser);
m_update.generated_sql += QStringLiteral("REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %1 FROM %2 CASCADE;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %1 FROM %2 CASCADE;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON TABLES FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON TABLES FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON FUNCTIONS FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON FUNCTIONS FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %1 REVOKE ALL ON SEQUENCES FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %1 REVOKE ALL ON SEQUENCES FROM %2;\n").arg(es).arg(sOldUser);
m_update.generated_sql += QStringLiteral("DROP USER %1;\n").arg(sOldUser);
*/
//backwards compatibility
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT SELECT, REFERENCES ON TABLES TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT EXECUTE ON FUNCTIONS TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("ALTER DEFAULT PRIVILEGES IN SCHEMA ") + es + QStringLiteral(" GRANT ALL ON SEQUENCES TO ") + sUser + QStringLiteral(";\n");
m_update.generated_sql += QStringLiteral("SET SEARCH_PATH TO %1;\n").arg(es);
m_update.generated_sql += m_update.exercise_sql;
m_update.generated_sql += QStringLiteral("\n");
m_update.generated_sql += QStringLiteral("INSERT INTO db_version (description, version) VALUES ('%1', '%2');\n\n").arg(m_update.info, m_update.version);
m_update.generated_sql += QStringLiteral("\n--COMMIT;\n\n");
}
}
DEBUG_LOG(m_logger) << "Generated sql size: " << m_update.generated_sql.size();
if (m_update.generated_sql.size() > 0)
{
QString sqlFile = DBUpdate::m_defaultPath + m_update.version;
if (m_update.project.size() > 0)
sqlFile += QStringLiteral("_") + m_update.project;
sqlFile += QStringLiteral("_run.sql");
QFile file(sqlFile);
if (file.open(QIODevice::WriteOnly | QFile::Truncate))
{
file.write(m_update.generated_sql.toUtf8());
file.write("\n");
file.close();
INFO_LOG(m_logger) << "Saved GENERATED UPDATE FILE: " << sqlFile;
m_update.generated_file = sqlFile;
}
else
{
ERROR_LOG(m_logger) << "Error opening file '" << file.fileName() << "' for writing: "
<< file.errorString();
m_update.generated_file = QString();
}
}
}
} // namespace DBUpdate
+117
View File
@@ -0,0 +1,117 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#pragma once
#include <QMainWindow>
#include <QStandardItemModel>
#include <QVector>
#include <QSqlDatabase>
#include <QProcess>
#include "logger.h"
#include "global_updates_model.h"
#include "exercises_model.h"
#include "show_history.h"
namespace Ui {
class DBUpdate;
}
namespace DBUpdate
{
struct Update
{
QString filename;
QString info;
QString project;
QString version;
QString date;
QString global_schemas;
QString exercise_schemas;
QString global_sql;
QString exercise_sql;
QString generated_sql;
QString generated_file;
};
class DBUpdate : public QMainWindow
{
friend class DBUpdateRun;
Q_OBJECT
public:
explicit DBUpdate(QWidget *parent = nullptr);
~DBUpdate();
bool init();
private slots:
void onClosedClicked();
void onUpdateLoad();
void onUpdateRun();
void onShowLogFile();
void onClearLogFile();
void onShowGlobalHistory(const QModelIndex &idx);
void onShowExerciseHistory(const QModelIndex &idx);
void onLoadSQL();
void onBackupDB();
private:
void enaDisa();
bool parseUpdateFile(const QString &fileName, bool showUi = true);
void saveUpdateSql();
private:
Ui::DBUpdate *m_ui;
QSqlDatabase m_db;
Update m_update;
bool m_showUi {true};
GlobalUpdatesModel *m_globalUpdatesModel{nullptr};
GlobalUpdatesProxyModel *m_globalUpdatesProxyModel{nullptr};
ExercisesModel *m_exercisesModel{nullptr};
ExercisesProxyModel *m_exercisesProxyModel{nullptr};
ShowHistory *m_showHistory{nullptr};
QString m_sql;
static QString m_defaultPath;
LOGGER_T m_logger;
};
class DBUpdateRun : public QObject
{
Q_OBJECT
public:
explicit DBUpdateRun(const QString &updateFile, bool generateOnly, bool withBackup, QObject *parent = nullptr);
~DBUpdateRun();
bool init();
bool runUpdate();
bool runPgDump(const QString &dumpFile, const QString &dbHost, const QString &dbName);
Q_SIGNALS:
void runSqlFailed();
void runSqlFinished();
void runPgDumpFailed();
void runPgDumpFinished();
private:
void onPsqlFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onPgDumpFinished(int exitCode, QProcess::ExitStatus exitStatus);
bool parseUpdateFile();
void generateSql();
bool runPsql();
QString executablePath(const QString &program);
void handleProcInit(const QString &program, const QStringList &args);
void handleProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onErrorOccured(QProcess::ProcessError error);
private:
QSqlDatabase m_db;
Update m_update;
bool m_generateOnly;
bool m_withBackup;
GlobalUpdatesModel *m_globalUpdatesModel{nullptr};
ExercisesModel *m_exercisesModel{nullptr};
QProcess *m_proc;
LOGGER_T m_logger;
};
} // namespace DBUpdate
+304
View File
@@ -0,0 +1,304 @@
/**
* @RDE_HEADER@
* DBUpdate - Exercises updates model
* $Id$
* $HeadURL$
* $Author$
*
* Created by Iuliana Ojog, 2021-02-17
*/
#include "exercises_model.h"
#include <ngltools/ngltools_dtg.h>
#include <ngldb/nsqlquery.h>
#include <QColor>
namespace DBUpdate
{
ExercisesModel::ExercisesModel(QObject *parent)
: QAbstractTableModel(parent)
, m_logger(getLogger("ExercisesModel"))
{}
ExercisesModel::~ExercisesModel()
{}
bool ExercisesModel::initModel(const QSqlDatabase &db, const QString &version, const QStringList &schemas)
{
beginResetModel();
m_vecData.clear();
endResetModel();
// no exercise updates
if (schemas.contains(QStringLiteral("NONE")))
return true;
NSqlQuery q(db), q1(db);
q.setForwardOnly(false);
QString stmt = QStringLiteral("SELECT id, name, begin_time, end_time, exercise_state_id FROM exm.exercise;");
if (!q.exec(stmt))
return false;
int upperVersion = version.split(QLatin1Char('.')).at(0).toInt();
int versionInt = version.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "versionInt: " << versionInt;
while (q.next())
{
ExerciseUpdate e;
e.id = q.value(0).toInt();
e.name = q.value(1).toString();
e.startTime = q.value(2).toLongLong();
e.endTime = q.value(3).toLongLong();
e.stateId = q.value(4).toInt();
e.schema = QStringLiteral("EX_")+QString::number(e.id);
e.isChecked = false;
QString stmt_db = QStringLiteral("SELECT id, version, description, updated, success FROM ") + e.schema +
QStringLiteral(".db_version WHERE success = true ORDER BY cast(regexp_replace(split_part(version,'.',1),'[^0-9]', '', 'g') as integer ) DESC"
", cast(regexp_replace(split_part(version,'.',2),'[^0-9]', '', 'g') as integer ) DESC, updated DESC LIMIT 1;");
if (q1.execAndFetch(stmt_db))
{
e.version = q1.value(1).toString();
e.description = q1.value(2).toString();
e.updated = q1.value(3).toLongLong();
}
int upperEVersion = e.version.split(QLatin1Char('.')).at(0).toInt();
int eVersion = e.version.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "eVersion: " << eVersion;
if (upperVersion <= upperEVersion && eVersion < versionInt)
e.isChecked = true;
int lastUpperVersion = m_lastUpdate.split(QLatin1Char('.')).at(0).toInt();
int lastUpdateInt = m_lastUpdate.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "lastUpdateInt: " << lastUpdateInt;
if ( upperEVersion > lastUpperVersion )
m_lastUpdate = e.version;
else if ( upperEVersion == lastUpperVersion && eVersion >= lastUpdateInt)
m_lastUpdate = e.version;
if (schemas.contains(e.schema, Qt::CaseInsensitive) ||
schemas.contains(QStringLiteral("ALL"), Qt::CaseInsensitive) || schemas.isEmpty() ||
(schemas.contains(QStringLiteral("NOT_TERMINATED"), Qt::CaseInsensitive) && e.stateId != 6))
insertRow(e);
}
INFO_LOG(m_logger) << "initModel - #exercises: " << m_vecData.size();
return true;
}
QVariant ExercisesModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() >= m_vecData.size())
return QVariant();
const ExerciseUpdate &e = m_vecData.at(index.row());
if (role == Qt::BackgroundRole && e.stateId == 6)
{
return QColor(Qt::gray);
}
if (role == Qt::DisplayRole)
{
switch (index.column())
{
case Id:
return e.id;
case Name:
return QString(e.name);
case StartTime:
return DTG::toStringMSec(e.startTime);
case EndTime:
return DTG::toStringMSec(e.endTime);
case StateId:
return toString(e.stateId);
case Version:
return e.version;
case Description:
return e.description;
case Updated:
return DTG::toStringMSec(e.updated);
case Schema:
return e.schema;
}
}
else if (role == Qt::CheckStateRole)
{
// CheckBoxes only for columns that are actually checkable
if (!flags(index).testFlag(Qt::ItemIsUserCheckable))
return QVariant();
if (index.column() == Columns::Schema)
return e.isChecked ? Qt::Checked : Qt::Unchecked;
}
return QVariant();
}
int ExercisesModel::rowCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : m_vecData.size();
}
int ExercisesModel::columnCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : Columns::Updated + 1;
}
QVariant ExercisesModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal
&& role == Qt::DisplayRole)
{
Columns col = static_cast<Columns>(section);
switch (col)
{
case Id:
return tr("Id");
case Name:
return tr("Exercise name");
case StartTime:
return tr("Start Time");
case EndTime:
return tr("End Time");
case StateId:
return tr("Exercise State");
case Schema:
return tr("Schema");
case Version:
return tr("Version");
case Description:
return tr("Description");
case Updated:
return tr("Updated");
}
}
return QAbstractTableModel::headerData(section, orientation, role);
}
ExerciseUpdate ExercisesModel::getRowData(int row) const
{
if (row < 0 || row >= m_vecData.size())
return ExerciseUpdate();
return m_vecData.at(row);
}
bool ExercisesModel::insertRow(const ExerciseUpdate &item)
{
beginInsertRows(QModelIndex(), m_vecData.size(), m_vecData.size());
m_vecData.append(item);
endInsertRows();
return true;
}
Qt::ItemFlags ExercisesModel::flags(const QModelIndex &index) const
{
auto f = QAbstractTableModel::flags(index);
if (!index.isValid() || index.row() >= m_vecData.size())
return f;
if (index.column() == Columns::Schema)
f.setFlag(Qt::ItemIsUserCheckable);
// if (!m_vecData[index.row()].isChecked)
// f.setFlag(Qt::ItemIsEnabled, false);
f.setFlag(Qt::ItemIsEditable, false);
f.setFlag(Qt::ItemIsSelectable, true);
return f;
}
bool ExercisesModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (!index.isValid())
return false;
if (role != Qt::CheckStateRole)
return false;
if (!value.canConvert<bool>())
return false;
bool bVal = value.toBool();
ExerciseUpdate &data = m_vecData[index.row()];
if (data.isChecked != bVal)
{
data.isChecked = bVal;
emit dataChanged(index, index);
}
return true;
}
QStringList ExercisesModel::getSchemasToUpdate()
{
QStringList schemas;
for(const ExerciseUpdate &eu : qAsConst(m_vecData))
{
if (eu.isChecked)
schemas << eu.schema;
}
return schemas;
}
void ExercisesProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
m_sourceModel = qobject_cast<ExercisesModel*>(sourceModel);
QSortFilterProxyModel::setSourceModel(sourceModel);
}
bool ExercisesProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
{
if (!m_sourceModel ||
source_left.column() != source_right.column() ||
!source_left.isValid() ||
!source_right.isValid())
return QSortFilterProxyModel::lessThan(source_left, source_right);
const auto &dataLeft = m_sourceModel->m_vecData.at(source_left.row());
const auto dataRight = m_sourceModel->m_vecData.at(source_right.row());
switch (source_left.column())
{
case ExercisesModel::StartTime:
return dataLeft.startTime < dataRight.startTime;
case ExercisesModel::EndTime:
return dataLeft.endTime < dataRight.endTime;
case ExercisesModel::Updated:
return dataLeft.updated < dataRight.updated;
}
return QSortFilterProxyModel::lessThan(source_left, source_right);
}
QString ExercisesModel::toString(int stateId) const
{
switch (stateId)
{
case 0:
return tr("Unknown");
case 1:
return tr("Created");
case 2:
return tr("Started");
case 3:
return tr("Paused");
case 5:
return tr("Stopped");
case 6:
return tr("Terminated");
default:
return tr("Unknown");
}
return QString::number(stateId);
}
} // namespace DBUpdate
+93
View File
@@ -0,0 +1,93 @@
/**
* @RDE_HEADER@
* DBUpdate - Exercises updates model
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#pragma once
#include "logger.h"
#include <QAbstractTableModel>
#include <QSortFilterProxyModel>
#include <QSqlDatabase>
namespace DBUpdate
{
struct ExerciseUpdate
{
qint32 id = 0;
QString name;
qint64 startTime = 0;
qint64 endTime = 0;
qint32 stateId = 0;
QString schema;
QString version = QStringLiteral("0.000");
QString description = QStringLiteral("no available information");
qint64 updated = 0;
bool isChecked = false;
};
class ExercisesModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Columns
{
Id = 0,
Schema,
Name,
StartTime,
EndTime,
StateId,
Version,
Description,
Updated
};
explicit ExercisesModel(QObject *parent = nullptr);
~ExercisesModel();
bool initModel(const QSqlDatabase &db, const QString &version = QStringLiteral("0.00"), const QStringList &schemas = {});
QVariant data(const QModelIndex &, int) const override final;
Qt::ItemFlags flags(const QModelIndex &index) const override final;
bool setData(const QModelIndex &index, const QVariant &value, int role) override final;
int rowCount(const QModelIndex &parent) const override final;
int columnCount(const QModelIndex &parent) const override final;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override final;
ExerciseUpdate getRowData(int row) const;
bool insertRow(const ExerciseUpdate &item);
QString toString(int stateId) const;
QStringList getSchemasToUpdate();
const QString getLastUpdate() { return m_lastUpdate; }
friend class ExercisesProxyModel;
protected:
private:
QString m_lastUpdate = QStringLiteral("0.00");
QVector<ExerciseUpdate> m_vecData;
LOGGER_T m_logger;
};
class ExercisesProxyModel final : public QSortFilterProxyModel
{
Q_OBJECT
public:
using QSortFilterProxyModel::QSortFilterProxyModel;
void setSourceModel(QAbstractItemModel *sourceModel) override;
protected:
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
private:
ExercisesModel *m_sourceModel = nullptr;
};
}
+243
View File
@@ -0,0 +1,243 @@
/**
* @RDE_HEADER@
* DBUpdate - Global updates model
* $Id$
* $HeadURL$
* $Author$
*
* Created by Iuliana Ojog, 2021-02-17
*/
#include "global_updates_model.h"
#include <ngldb/nsqlquery.h>
#include <ngltools/ngltools_dtg.h>
#include <QStringList>
namespace DBUpdate
{
GlobalUpdatesModel::GlobalUpdatesModel(QObject *parent)
: QAbstractTableModel(parent)
, m_logger(getLogger("GlobalUpdatesModel"))
{
}
GlobalUpdatesModel::~GlobalUpdatesModel()
{
}
bool GlobalUpdatesModel::initModel(const QSqlDatabase &db, const QString &version, QStringList schemas)
{
beginResetModel();
m_vecData.clear();
endResetModel();
// no global updates
if (schemas.contains(QStringLiteral("NONE"), Qt::CaseInsensitive))
return true;
// all global schemas
if (schemas.contains(QStringLiteral("ALL"), Qt::CaseInsensitive))
schemas = global_schemas;
NSqlQuery q(db);
q.setForwardOnly(false);
int upperVersion = version.split(QLatin1Char('.')).at(0).toInt();
int versionInt = version.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "versionInt: " << versionInt;
DEBUG_LOG(m_logger) << "upperVersion: " << upperVersion;
for (const QString &schema: qAsConst(schemas))
{
GlobalUpdate gu;
gu.schema = schema;
gu.isChecked = false;
QString stmt = QStringLiteral("SELECT id, version, description, updated, success FROM ") + schema
+ QStringLiteral(".db_version WHERE success = true ORDER BY cast(regexp_replace(split_part(version,'.',1),'[^0-9]', '', 'g') as integer ) DESC"
", cast(regexp_replace(split_part(version,'.',2),'[^0-9]', '', 'g') as integer ) DESC, updated DESC LIMIT 1;");
if (q.execAndFetch(stmt))
{
gu.version = q.value(1).toString();
gu.description = q.value(2).toString();
gu.updated = q.value(3).toLongLong();
}
int upperGuVersion = gu.version.split(QLatin1Char('.')).at(0).toInt();
int guVersion = gu.version.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "guVersion: " << guVersion;
DEBUG_LOG(m_logger) << "upperGuVersion: " << upperGuVersion;
if (upperGuVersion <= upperVersion && guVersion < versionInt)
gu.isChecked = true;
int lastUpperVersion = m_lastUpdate.split(QLatin1Char('.')).at(0).toInt();
int lastUpdateInt = m_lastUpdate.section(QLatin1Char('.'), 1).toInt();
DEBUG_LOG(m_logger) << "lastUpdateInt: " << lastUpdateInt;
DEBUG_LOG(m_logger) << "lastUpperVersion: " << lastUpperVersion;
DEBUG_LOG(m_logger) << "gu.version: " << gu.version << ", lastUpdate: " << m_lastUpdate;
if ( upperGuVersion > lastUpperVersion )
m_lastUpdate = gu.version;
else if ( upperGuVersion == lastUpperVersion && guVersion >= lastUpdateInt)
m_lastUpdate = gu.version;
insertRow(gu);
}
INFO_LOG(m_logger) << "initModel - #global updates: " << m_vecData.size();
return true;
}
QVariant GlobalUpdatesModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() >= m_vecData.size())
return QVariant();
const GlobalUpdate &gu = m_vecData.at(index.row());
if (role == Qt::DisplayRole)
{
switch (index.column())
{
case Schema:
return QString(gu.schema);
case Version:
return QString(gu.version);
case Description:
return QString(gu.description);
case Updated:
return DTG::toStringMSec(gu.updated);
}
}
else if (role == Qt::CheckStateRole)
{
// CheckBoxes only for columns that are actually checkable
if (!flags(index).testFlag(Qt::ItemIsUserCheckable))
return QVariant();
if (index.column() == Columns::Schema)
return gu.isChecked ? Qt::Checked : Qt::Unchecked;
}
return QVariant();
}
int GlobalUpdatesModel::rowCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : m_vecData.size();
}
int GlobalUpdatesModel::columnCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : Columns::Updated + 1;
}
QVariant GlobalUpdatesModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal
&& role == Qt::DisplayRole)
{
Columns col = static_cast<Columns>(section);
switch (col)
{
case Schema:
return tr("Schema");
case Version:
return tr("Version");
case Description:
return tr("Description");
case Updated:
return tr("Updated");
}
}
return QAbstractTableModel::headerData(section, orientation, role);
}
GlobalUpdate GlobalUpdatesModel::getRowData(int row) const
{
if (row < 0 || row >= m_vecData.size())
return GlobalUpdate();
return m_vecData.at(row);
}
bool GlobalUpdatesModel::insertRow(const GlobalUpdate &item)
{
beginInsertRows(QModelIndex(), m_vecData.size(), m_vecData.size());
m_vecData.append(item);
endInsertRows();
return true;
}
Qt::ItemFlags GlobalUpdatesModel::flags(const QModelIndex &index) const
{
auto f = QAbstractTableModel::flags(index);
if (!index.isValid() || index.row() >= m_vecData.size())
return f;
if (index.column() == Columns::Schema)
f.setFlag(Qt::ItemIsUserCheckable);
//if (!m_vecData[index.row()].isChecked)
// f.setFlag(Qt::ItemIsEnabled, false);
f.setFlag(Qt::ItemIsEditable, false);
f.setFlag(Qt::ItemIsSelectable, true);
return f;
}
bool GlobalUpdatesModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (!index.isValid())
return false;
if (role != Qt::CheckStateRole)
return false;
if (!value.canConvert<bool>())
return false;
bool bVal = value.toBool();
GlobalUpdate &data = m_vecData[index.row()];
if (data.isChecked != bVal)
{
data.isChecked = bVal;
emit dataChanged(index, index);
}
return true;
}
QStringList GlobalUpdatesModel::getSchemasToUpdate()
{
QStringList schemas;
for(const GlobalUpdate &gu : qAsConst(m_vecData))
{
if (gu.isChecked)
schemas << gu.schema;
}
return schemas;
}
void GlobalUpdatesProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
m_sourceModel = qobject_cast<GlobalUpdatesModel*>(sourceModel);
QSortFilterProxyModel::setSourceModel(sourceModel);
}
bool GlobalUpdatesProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
{
if (!m_sourceModel ||
source_left.column() != source_right.column() ||
!source_left.isValid() ||
!source_right.isValid())
return QSortFilterProxyModel::lessThan(source_left, source_right);
const auto &dataLeft = m_sourceModel->m_vecData.at(source_left.row());
const auto dataRight = m_sourceModel->m_vecData.at(source_right.row());
switch (source_left.column())
{
case GlobalUpdatesModel::Updated:
return dataLeft.updated < dataRight.updated;
}
return QSortFilterProxyModel::lessThan(source_left, source_right);
}
} // namespace
+105
View File
@@ -0,0 +1,105 @@
/**
* @RDE_HEADER@
* DBUpdate - Global updates model
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#pragma once
#include "logger.h"
#include <QAbstractTableModel>
#include <QSortFilterProxyModel>
#include <QSqlDatabase>
namespace DBUpdate
{
//TODO: when a new global schema is defined, should be also added here. Or dynamic collect the schemas. Current status: 2022.10.06
static const QStringList &global_schemas = { QStringLiteral("AES"),
QStringLiteral("ASM"),
QStringLiteral("AVM"),
QStringLiteral("CORE"),
QStringLiteral("EXM"),
QStringLiteral("FLM"),
QStringLiteral("FLT"),
QStringLiteral("GNA"),
QStringLiteral("ISM"),
QStringLiteral("MDM"),
QStringLiteral("MSG"),
QStringLiteral("NOM"),
QStringLiteral("OPM"),
QStringLiteral("PDM"),
QStringLiteral("PPM"),
QStringLiteral("SOM"),
QStringLiteral("SRM"),
QStringLiteral("TAB"),
QStringLiteral("WHG"),
QStringLiteral("PUBLIC")
};
struct GlobalUpdate
{
QString schema;
QString version = QStringLiteral("0.000");
QString description = QStringLiteral("no available information");
qint64 updated = 0;
bool isChecked = false;
};
class GlobalUpdatesModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Columns
{
Schema,
Version,
Description,
Updated
};
explicit GlobalUpdatesModel(QObject *parent = nullptr);
~GlobalUpdatesModel();
bool initModel(const QSqlDatabase &db, const QString &version = QStringLiteral("0.00"), QStringList schemas = global_schemas);
QVariant data(const QModelIndex &, int) const override final;
bool setData(const QModelIndex &index, const QVariant &value, int role) override final;
Qt::ItemFlags flags(const QModelIndex &index) const override final;
int rowCount(const QModelIndex &parent) const override final;
int columnCount(const QModelIndex &parent) const override final;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override final;
GlobalUpdate getRowData(int row) const;
bool insertRow(const GlobalUpdate &item);
QStringList getSchemasToUpdate();
const QString getLastUpdate() { return m_lastUpdate; }
friend class GlobalUpdatesProxyModel;
private:
QString m_lastUpdate = QStringLiteral("0.000");
QVector<GlobalUpdate> m_vecData;
LOGGER_T m_logger;
};
class GlobalUpdatesProxyModel final : public QSortFilterProxyModel
{
Q_OBJECT
public:
using QSortFilterProxyModel::QSortFilterProxyModel;
void setSourceModel(QAbstractItemModel *sourceModel) override;
protected:
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
private:
GlobalUpdatesModel *m_sourceModel = nullptr;
};
}
+161
View File
@@ -0,0 +1,161 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#include "history_model.h"
#include <ngldb/nsqlquery.h>
#include <ngltools/ngltools_dtg.h>
namespace DBUpdate
{
HistoryModel::HistoryModel(QObject *parent)
: QAbstractTableModel(parent)
, m_logger(getLogger("HistoryModel"))
{
}
HistoryModel::~HistoryModel()
{
}
bool HistoryModel::initModel(const QSqlDatabase &db, const QString &schema)
{
beginResetModel();
m_vecData.clear();
endResetModel();
NSqlQuery q(db);
QString stmt = QStringLiteral("SELECT id, version, description, updated, success, message FROM ") + schema + QStringLiteral(".db_version ORDER BY version DESC, updated DESC;");
if (!q.exec(stmt))
return false;
while (q.next())
{
HistoryUpdate hu;
hu.schema = schema;
hu.id = q.value(0).toInt();
hu.version = q.value(1).toString();
hu.description = q.value(2).toString();
hu.updated = q.value(3).toLongLong();
hu.success = q.value(4).toBool();
hu.message = q.value(5).toString();
insertRow(hu);
}
INFO_LOG(m_logger) << "initModel - #history updates: " << m_vecData.size();
return true;
}
QVariant HistoryModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() >= m_vecData.size())
return QVariant();
const HistoryUpdate &hu = m_vecData.at(index.row());
if (role == Qt::DisplayRole)
{
switch (index.column())
{
case Id:
return hu.id;
case Schema:
return QString(hu.schema);
case Version:
return QString(hu.version);
case Description:
return QString(hu.description);
case Updated:
return DTG::toStringMSec(hu.updated);
case Success:
return hu.success;
case Message:
return hu.message;
}
}
return QVariant();
}
int HistoryModel::rowCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : m_vecData.size();
}
int HistoryModel::columnCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : Columns::Message + 1;
}
QVariant HistoryModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
Columns col = static_cast<Columns>(section);
switch (col)
{
case Id:
return tr("Id");
case Schema:
return tr("Schema");
case Version:
return tr("Version");
case Description:
return tr("Description");
case Updated:
return tr("Updated");
case Message:
return tr("Message");
case Success:
return tr("Success");
}
}
return QAbstractTableModel::headerData(section, orientation, role);
}
HistoryUpdate HistoryModel::getRowData(int row) const
{
if (row < 0 || row >= m_vecData.size())
return HistoryUpdate();
return m_vecData.at(row);
}
bool HistoryModel::insertRow(const HistoryUpdate &item)
{
beginInsertRows(QModelIndex(), m_vecData.size(), m_vecData.size());
m_vecData.append(item);
endInsertRows();
return true;
}
void HistoryProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
m_sourceModel = qobject_cast<HistoryModel*>(sourceModel);
QSortFilterProxyModel::setSourceModel(sourceModel);
}
bool HistoryProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
{
if (!m_sourceModel ||
source_left.column() != source_right.column() ||
!source_left.isValid() ||
!source_right.isValid())
return QSortFilterProxyModel::lessThan(source_left, source_right);
const auto &dataLeft = m_sourceModel->m_vecData.at(source_left.row());
const auto dataRight = m_sourceModel->m_vecData.at(source_right.row());
switch (source_left.column())
{
case HistoryModel::Updated:
return dataLeft.updated < dataRight.updated;
}
return QSortFilterProxyModel::lessThan(source_left, source_right);
}
} // namespace
+79
View File
@@ -0,0 +1,79 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#pragma once
#include "logger.h"
#include <QAbstractTableModel>
#include <QSortFilterProxyModel>
#include <QSqlDatabase>
namespace DBUpdate
{
struct HistoryUpdate
{
qint64 id;
QString schema;
QString version;
QString description;
qint64 updated;
bool success;
QString message;
};
class HistoryModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Columns
{
Id,
Schema,
Version,
Description,
Updated,
Success,
Message
};
explicit HistoryModel(QObject *parent = nullptr);
~HistoryModel();
bool initModel(const QSqlDatabase &db, const QString &schema);
QVariant data(const QModelIndex &, int) const override final;
int rowCount(const QModelIndex &parent) const override final;
int columnCount(const QModelIndex &parent) const override final;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override final;
HistoryUpdate getRowData(int row) const;
bool insertRow(const HistoryUpdate &item);
friend class HistoryProxyModel;
private:
QVector<HistoryUpdate> m_vecData;
LOGGER_T m_logger;
};
class HistoryProxyModel final : public QSortFilterProxyModel
{
Q_OBJECT
public:
using QSortFilterProxyModel::QSortFilterProxyModel;
void setSourceModel(QAbstractItemModel *sourceModel) override;
protected:
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
private:
HistoryModel *m_sourceModel = nullptr;
};
}
+79
View File
@@ -0,0 +1,79 @@
log4j.reset=true
log4j.rootLogger=WARN, file
# DBUpdate
###########################################################
log4j.logger.DBU=DEBUG
log4j.logger.DBU.main=DEBUG
log4j.logger.DBU.DbUpdate=DEBUG
log4j.logger.DBU.ShowLogFile=DEBUG
# File
###########################################################
log4j.appender.file=Lts::RollingFileAppender
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=9
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %-5p %c |#| %m (%.50F:%L) %n
# Appnd_Console
###########################################################
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern= %d %p %c %c{1} - %m (%-.30F:%L) %n
# Appnd_Syslog
###########################################################
log4j.appender.syslog=org.apache.log4j.SyslogAppender
log4j.appender.syslog.Threshold=ERROR
log4j.appender.syslog.SysLogHost=localhost
log4j.appender.syslog.Facility=LOCAL7
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.ConversionPattern= %-4r %-5p %c %x - %m
log4j.appender.syslog.LevelRangeFilter.AcceptOnMatch=true
log4j.appender.syslog.LevelRangeFilter.LevelMin=INFO
log4j.appender.syslog.LevelRangeFilter.LevelMax=FATAL
###########################################################
###########################################################
###########################################################
# 1) Available Levels in LOG4CXX Version 0.10.0:
# TRACE,
# DEBUG,
# INFO,
# WARN,
# ERROR
# FATAL
#
# d = date/time
# p = priority (Level)
# c = category/channel
# m = message
# F = file
# L = line
# n = platform dependent line separator character or characters.
# ....
#
# Examples for console:
# a)
# %d %p %c #%m# (%.50F:%L)%n
# date/time
# priority
# category/channel
# #message#
# (Maximal 50Character des Filename von rechts:Line)
# line separator
#
# b)
# %d (%.15F:%L) %-5p %c |#| %m%n
# date/time
# (Maximal 15Character des Filename von rechts:Line)
# priority, Right pad with spaces if the priority name is less than 5 characters long.
# category/channel
# message
# line separator
#
# Examples for files:
+37
View File
@@ -0,0 +1,37 @@
/**
* @RDE_HEADER@
* DBUpdate - logging
* $Id$
* $HeadURL$
* $Author$
*/
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace DBUpdate
{
LOGGER_T getLogger(const char *name)
{
static const char ns[] = "DBU.";
std::string loggerName;
const size_t len = strlen(name);
loggerName.reserve(sizeof(ns) + len);
loggerName.append(ns, sizeof(ns) - 1);
loggerName.append(name, len);
try
{
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
getNGLLogger(loggerName);
}
catch (const std::exception &ex)
{
fprintf(stderr, "Error retrieving logger: %s", ex.what());
abort();
}
}
} // namespace DBUpdate
+22
View File
@@ -0,0 +1,22 @@
/**
* @RDE_HEADER@
* Logging for DBUpdate
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <NGLLogger/INGLLogger.h>
namespace DBUpdate
{
typedef NGL::INGLLogger &LOGGER_T;
LOGGER_T getLogger(const char *name);
inline LOGGER_T getLogger(const QString &loggerName)
{
return getLogger(loggerName.toUtf8().constData());
}
} // namespace DBUpdate
+151
View File
@@ -0,0 +1,151 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#include "db_update.h"
#include <NGLLogger/INGLLogger.h>
#include <nglapplication/nglapplication.h>
#include <nglapplication/nglcoreapplication.h>
#include <ngltranslator/ngltranslator.h>
#include <LtsCommandLineParser/LtsCommandLineParser.h>
#include <QInputDialog>
class CmdLineParser : public LtsCommandLineParser::LtsCommandLineParser
{
public:
CmdLineParser()
: LtsCommandLineParser(ProvideCommandLineParameterOptions::None)
{
addOption({{QStringLiteral("l"), QStringLiteral("lang")},
QStringLiteral("Language iso code to use (de_DE, en_GB, en_US)"),
QStringLiteral("<locale iso code>")
});
addOption({{QStringLiteral("u"), QStringLiteral("update")},
QStringLiteral("Update file (*.upd)"),
QStringLiteral("<update file>")
});
addOption({{QStringLiteral("p"), QStringLiteral("pass")},
QStringLiteral("Password"),
QStringLiteral("<password>")
});
addOption({{QStringLiteral("g"), QStringLiteral("only generate sql")},
QStringLiteral("Only generate sql (do no execute)")
});
addOption({{QStringLiteral("b"), QStringLiteral("Backup first")},
QStringLiteral("Make a database backup first")
});
}
bool onlyGenerate() const
{
return isSet(QStringLiteral("g"));
}
bool withBackup() const
{
return isSet(QStringLiteral("b"));
}
QString langIsoCode() const { return value(QStringLiteral("l")); }
QString updateFile() const { return value(QStringLiteral("u")); }
QString pass() const { return value(QStringLiteral("p")); }
};
int main(int argc, char *argv[])
{
int retval = -1;
bool bHeadless = false;
for (int i = 1; i < argc; ++i)
{
if (strcmp(argv[i], "-u") == 0) // given the update file on commando line
{
bHeadless = true;
break;
}
}
QScopedPointer<QCoreApplication> app;
app.reset(bHeadless ? dynamic_cast<QCoreApplication*>(new NGLCoreApplication(argc, argv))
: dynamic_cast<QCoreApplication*>(new NGLApplication(argc, argv)));
QCoreApplication::setApplicationName(QLatin1String("DBUpdate"));
QCoreApplication::setOrganizationName(QLatin1String("RME"));
if (!bHeadless)
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
NGL::LoggerHandler *lh = dynamic_cast<NGL::LoggerHandler*>(app.data());
lh->createLogger("dbu", "log4cxx_dbu.props");
NGL::INGLLogger &logger = lh->baseLogger();
// Parse Options
CmdLineParser options;
if (!options.init())
return retval;
// Set Translation
QString langIsoCode = options.langIsoCode();
if (langIsoCode.isEmpty())
langIsoCode = QLocale::system().name();
NGL::setTranslationLocale(langIsoCode.toLatin1());
STARTUP_LOG(logger);
if (bHeadless)
{
QString pwd = options.pass();
if (pwd.isEmpty() || pwd != QStringLiteral("geheim"))
{
ERROR_LOG(logger) << "Incorrect password !!!";
return -3;
}
DEBUG_LOG(logger) << "Running headless, update file: " << options.updateFile() << ", Generate only: " << options.onlyGenerate();
DBUpdate::DBUpdateRun *up = new DBUpdate::DBUpdateRun(options.updateFile(), options.onlyGenerate(), options.withBackup());
if (!up->init())
{
ERROR_LOG(logger) << "Failed to init DBUpdateHeadless";
return -2;
}
if (!up->runUpdate())
{
ERROR_LOG(logger) << "Failed to run update: " << options.updateFile();
return -1;
}
retval = 0;
}
else
{
bool ok;
QString pass = QInputDialog::getText(nullptr,
QCoreApplication::tr("Password"),
QCoreApplication::tr("Please enter the password:"), QLineEdit::Password,
QString(), &ok); // blocking, no event loop needed
if (!ok || pass.isEmpty() || pass.toLower() != QStringLiteral("geheim"))
{
ERROR_LOG(logger) << "Incorrect password !!!";
return -3;
}
QScopedPointer<DBUpdate::DBUpdate> mainWindow(new DBUpdate::DBUpdate);
if (!mainWindow->init())
{
ERROR_LOG(logger) << "Failed to init DBUpdate";
return -2;
}
mainWindow->show();
QGuiApplication::setQuitOnLastWindowClosed(true);
retval = QCoreApplication::exec();
if (retval < 0)
ERROR_LOG(logger) << "Failed: " << retval;
}
SHUTDOWN_LOG(logger);
return retval;
}
+49
View File
@@ -0,0 +1,49 @@
/**
* @RDE_HEADER@
* DBUpdate - Show history
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#include "show_history.h"
#include "ui_show_history.h"
#include <nglsettings/nglsettings_settings.h>
namespace DBUpdate
{
ShowHistory::ShowHistory(QWidget *parent)
: QWidget(parent)
, m_ui(new Ui::ShowHistory)
, m_logger(getLogger("ShowHistory"))
{
m_ui->setupUi(this);
connect(m_ui->pbClose, &QPushButton::clicked, this, &ShowHistory::onClosedClicked);
}
ShowHistory::~ShowHistory()
{
delete m_ui;
}
bool ShowHistory::init(const QSqlDatabase &db, const QString &schema)
{
m_model = new HistoryModel(this);
m_proxyModel = new HistoryProxyModel(this);
m_model->initModel(db, schema);
m_proxyModel->setSourceModel(m_model);
m_ui->tvHistory->setModel(m_proxyModel);
m_ui->tvHistory->resizeColumnsToContents();
return true;
}
void ShowHistory::onClosedClicked()
{
close();
}
} // namespace DBUpdate
+43
View File
@@ -0,0 +1,43 @@
/**
* @RDE_HEADER@
* DBUpdate
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, 2021-02-17
*/
#pragma once
#include "logger.h"
#include "history_model.h"
#include <QWidget>
#include <QSqlDatabase>
namespace Ui {
class ShowHistory;
}
namespace DBUpdate
{
class ShowHistory : public QWidget
{
Q_OBJECT
public:
explicit ShowHistory(QWidget *parent = nullptr);
~ShowHistory();
bool init(const QSqlDatabase &db, const QString &schema);
private slots:
void onClosedClicked();
private:
Ui::ShowHistory *m_ui;
HistoryModel *m_model{nullptr};
HistoryProxyModel *m_proxyModel{nullptr};
LOGGER_T m_logger;
};
}
+543
View File
@@ -0,0 +1,543 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DBUpdate</class>
<widget class="QMainWindow" name="DBUpdate">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1180</width>
<height>732</height>
</rect>
</property>
<property name="windowTitle">
<string>Database update</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="gbDatabase">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="lblDatabase">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Database:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDbConnection">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">DatabaseHost / DatabaseName</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lblCurrentVersion">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Current version:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblVersion">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">000.00</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tbBackup">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Backup</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabRun">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabUpdates">
<attribute name="title">
<string>Database Updates</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lblGlobalUpdates">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Global updates:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tvGlobalUpdates">
<property name="enabled">
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="lblExerciseUpdates">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Exercise updates:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tvExerciseUpdates">
<property name="enabled">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="tbLoadUpdate">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Load update</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblCurrentUpdate">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>Current update:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblSelectedUpdate">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>(no update loaded)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="tbRunUpdate">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Run update</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="teHeader">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>234</red>
<green>234</green>
<blue>234</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>234</red>
<green>234</green>
<blue>234</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabLog">
<attribute name="title">
<string>Log File</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="tbShowLog">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>Show log file</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tbClearLog">
<property name="text">
<string>Clear log file</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="pteLogFile">
<property name="enabled">
<bool>true</bool>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabQuery">
<attribute name="title">
<string>Queries</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QToolButton" name="tbLoadSQL">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Load SQL</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblSQL">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>&lt;SQL File&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPlainTextEdit" name="pteSQL">
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="tbClose">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Close</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
+71
View File
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ShowHistory</class>
<widget class="QWidget" name="ShowHistory">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>845</width>
<height>532</height>
</rect>
</property>
<property name="windowTitle">
<string>Show History</string>
</property>
<property name="statusTip">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableView" name="tvHistory">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pbClose">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
<slots>
<slot>oeffnenClicked()</slot>
</slots>
</ui>
+396
View File
@@ -0,0 +1,396 @@
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA AES GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_AES;
ALTER DEFAULT PRIVILEGES IN SCHEMA AES GRANT SELECT, REFERENCES ON TABLES TO ets_AES;
ALTER DEFAULT PRIVILEGES IN SCHEMA AES GRANT EXECUTE ON FUNCTIONS TO ets_AES;
ALTER DEFAULT PRIVILEGES IN SCHEMA AES GRANT ALL ON SEQUENCES TO ets_AES;
SET SEARCH_PATH TO AES;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA ASM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_ASM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ASM GRANT SELECT, REFERENCES ON TABLES TO ets_ASM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ASM GRANT EXECUTE ON FUNCTIONS TO ets_ASM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ASM GRANT ALL ON SEQUENCES TO ets_ASM;
SET SEARCH_PATH TO ASM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA AVM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_AVM;
ALTER DEFAULT PRIVILEGES IN SCHEMA AVM GRANT SELECT, REFERENCES ON TABLES TO ets_AVM;
ALTER DEFAULT PRIVILEGES IN SCHEMA AVM GRANT EXECUTE ON FUNCTIONS TO ets_AVM;
ALTER DEFAULT PRIVILEGES IN SCHEMA AVM GRANT ALL ON SEQUENCES TO ets_AVM;
SET SEARCH_PATH TO AVM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA CORE GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_CORE;
ALTER DEFAULT PRIVILEGES IN SCHEMA CORE GRANT SELECT, REFERENCES ON TABLES TO ets_CORE;
ALTER DEFAULT PRIVILEGES IN SCHEMA CORE GRANT EXECUTE ON FUNCTIONS TO ets_CORE;
ALTER DEFAULT PRIVILEGES IN SCHEMA CORE GRANT ALL ON SEQUENCES TO ets_CORE;
SET SEARCH_PATH TO CORE;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA EXM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_EXM;
ALTER DEFAULT PRIVILEGES IN SCHEMA EXM GRANT SELECT, REFERENCES ON TABLES TO ets_EXM;
ALTER DEFAULT PRIVILEGES IN SCHEMA EXM GRANT EXECUTE ON FUNCTIONS TO ets_EXM;
ALTER DEFAULT PRIVILEGES IN SCHEMA EXM GRANT ALL ON SEQUENCES TO ets_EXM;
SET SEARCH_PATH TO EXM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_FLM;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLM GRANT SELECT, REFERENCES ON TABLES TO ets_FLM;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLM GRANT EXECUTE ON FUNCTIONS TO ets_FLM;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLM GRANT ALL ON SEQUENCES TO ets_FLM;
SET SEARCH_PATH TO FLM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLT GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_FLT;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLT GRANT SELECT, REFERENCES ON TABLES TO ets_FLT;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLT GRANT EXECUTE ON FUNCTIONS TO ets_FLT;
ALTER DEFAULT PRIVILEGES IN SCHEMA FLT GRANT ALL ON SEQUENCES TO ets_FLT;
SET SEARCH_PATH TO FLT;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA GNA GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_GNA;
ALTER DEFAULT PRIVILEGES IN SCHEMA GNA GRANT SELECT, REFERENCES ON TABLES TO ets_GNA;
ALTER DEFAULT PRIVILEGES IN SCHEMA GNA GRANT EXECUTE ON FUNCTIONS TO ets_GNA;
ALTER DEFAULT PRIVILEGES IN SCHEMA GNA GRANT ALL ON SEQUENCES TO ets_GNA;
SET SEARCH_PATH TO GNA;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA ISM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_ISM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ISM GRANT SELECT, REFERENCES ON TABLES TO ets_ISM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ISM GRANT EXECUTE ON FUNCTIONS TO ets_ISM;
ALTER DEFAULT PRIVILEGES IN SCHEMA ISM GRANT ALL ON SEQUENCES TO ets_ISM;
SET SEARCH_PATH TO ISM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA MDM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_MDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA MDM GRANT SELECT, REFERENCES ON TABLES TO ets_MDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA MDM GRANT EXECUTE ON FUNCTIONS TO ets_MDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA MDM GRANT ALL ON SEQUENCES TO ets_MDM;
SET SEARCH_PATH TO MDM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA MSG GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_MSG;
ALTER DEFAULT PRIVILEGES IN SCHEMA MSG GRANT SELECT, REFERENCES ON TABLES TO ets_MSG;
ALTER DEFAULT PRIVILEGES IN SCHEMA MSG GRANT EXECUTE ON FUNCTIONS TO ets_MSG;
ALTER DEFAULT PRIVILEGES IN SCHEMA MSG GRANT ALL ON SEQUENCES TO ets_MSG;
SET SEARCH_PATH TO MSG;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA OPM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_OPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA OPM GRANT SELECT, REFERENCES ON TABLES TO ets_OPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA OPM GRANT EXECUTE ON FUNCTIONS TO ets_OPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA OPM GRANT ALL ON SEQUENCES TO ets_OPM;
SET SEARCH_PATH TO OPM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA PDM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_PDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PDM GRANT SELECT, REFERENCES ON TABLES TO ets_PDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PDM GRANT EXECUTE ON FUNCTIONS TO ets_PDM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PDM GRANT ALL ON SEQUENCES TO ets_PDM;
SET SEARCH_PATH TO PDM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA PPM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_PPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PPM GRANT SELECT, REFERENCES ON TABLES TO ets_PPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PPM GRANT EXECUTE ON FUNCTIONS TO ets_PPM;
ALTER DEFAULT PRIVILEGES IN SCHEMA PPM GRANT ALL ON SEQUENCES TO ets_PPM;
SET SEARCH_PATH TO PPM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA SOM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_SOM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SOM GRANT SELECT, REFERENCES ON TABLES TO ets_SOM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SOM GRANT EXECUTE ON FUNCTIONS TO ets_SOM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SOM GRANT ALL ON SEQUENCES TO ets_SOM;
SET SEARCH_PATH TO SOM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA SRM GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_SRM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SRM GRANT SELECT, REFERENCES ON TABLES TO ets_SRM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SRM GRANT EXECUTE ON FUNCTIONS TO ets_SRM;
ALTER DEFAULT PRIVILEGES IN SCHEMA SRM GRANT ALL ON SEQUENCES TO ets_SRM;
SET SEARCH_PATH TO SRM;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA TAB GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_TAB;
ALTER DEFAULT PRIVILEGES IN SCHEMA TAB GRANT SELECT, REFERENCES ON TABLES TO ets_TAB;
ALTER DEFAULT PRIVILEGES IN SCHEMA TAB GRANT EXECUTE ON FUNCTIONS TO ets_TAB;
ALTER DEFAULT PRIVILEGES IN SCHEMA TAB GRANT ALL ON SEQUENCES TO ets_TAB;
SET SEARCH_PATH TO TAB;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
ALTER DEFAULT PRIVILEGES IN SCHEMA WHG GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON TABLES TO ets_WHG;
ALTER DEFAULT PRIVILEGES IN SCHEMA WHG GRANT SELECT, REFERENCES ON TABLES TO ets_WHG;
ALTER DEFAULT PRIVILEGES IN SCHEMA WHG GRANT EXECUTE ON FUNCTIONS TO ets_WHG;
ALTER DEFAULT PRIVILEGES IN SCHEMA WHG GRANT ALL ON SEQUENCES TO ets_WHG;
SET SEARCH_PATH TO WHG;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
--BEGIN;
SET SEARCH_PATH TO PUBLIC;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
INSERT INTO db_version (description, version) VALUES ('Create db_version table for all existent DB schemas', '1.00');
--COMMIT;
@@ -0,0 +1,34 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Create db_version table for all existent DB schemas
-- PROJECT: ALL
-- DATE: 2021-02-10
-- VERSION: 1.00
-------------------------------------------------------------------------
-- GLOBAL: ALL;
BEGIN;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
COMMIT;
-- EXERCISE: ALL;
BEGIN;
CREATE TABLE IF NOT EXISTS db_version (
id serial,
description text,
version text,
updated bigint DEFAULT (extract(epoch from now()) * 1000),
success boolean DEFAULT true,
message text
);
COMMIT;
+40
View File
@@ -0,0 +1,40 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Create new DB user ets_ex_00 and set grants, create public function to reset user grants
-- PROJECT: ALL
-- DATE: 2022-02-16
-- VERSION: 2.00
-------------------------------------------------------------------------
-- GLOBAL: PUBLIC;
BEGIN;
SELECT create_user_if_not_exists('ets_ex_00');
CREATE OR REPLACE FUNCTION public.revoke_user_if_exists(rolename text, schema text) RETURNS TEXT AS
$$
BEGIN
IF EXISTS (SELECT * FROM pg_roles WHERE rolname = rolename) THEN
EXECUTE format('REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %s FROM %s CASCADE;', schema, rolename);
EXECUTE format('REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %s FROM %s CASCADE;', schema, rolename);
EXECUTE format('REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA %s FROM %s CASCADE;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %s REVOKE ALL ON TABLES FROM %s;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %s REVOKE ALL ON TABLES FROM %s;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %s REVOKE ALL ON FUNCTIONS FROM %s;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %s REVOKE ALL ON FUNCTIONS FROM %s;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA %s REVOKE ALL ON SEQUENCES FROM %s;', schema, rolename);
EXECUTE format('ALTER DEFAULT PRIVILEGES FOR ROLE ets_exm IN SCHEMA %s REVOKE ALL ON SEQUENCES FROM %s;', schema, rolename);
RETURN 'USER REVOKED';
ELSE
RETURN format('USER ''%I'' DOES NOT EXIST', rolename);
END IF;
END;
$$
LANGUAGE plpgsql;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
--BEGIN;
SET SEARCH_PATH TO PUBLIC;
-- create user and schema
SELECT create_user_if_not_exists('ets_flt');
-- GRANT ets_ro TO ets_flt;
GRANT ets_flt TO ets_admin;
CREATE SCHEMA IF NOT EXISTS flt;
ALTER SCHEMA flt OWNER TO ets_flt;
GRANT ALL ON SCHEMA flt TO ets_admin;
INSERT INTO db_version (description, version) VALUES ('Create new DB user ets_flt and global schema flt', '2.40');
--COMMIT;
+23
View File
@@ -0,0 +1,23 @@
-------------------------------------------------------------------------
-- INFO: Create new DB user ets_flt and global schema flt
-- PROJECT: ALL
-- DATE: 2022-10-06
-- VERSION: 2.40
-------------------------------------------------------------------------
-- GLOBAL: PUBLIC;
BEGIN;
-- create user and schema
SELECT create_user_if_not_exists('ets_flt');
-- GRANT ets_ro TO ets_flt;
GRANT ets_flt TO ets_admin;
CREATE SCHEMA IF NOT EXISTS flt;
ALTER SCHEMA flt OWNER TO ets_flt;
GRANT ALL ON SCHEMA flt TO ets_admin;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update column ex_NN.rec_equipment_state.vulnerability_kind_id = pdm_vulnerability_kind.ta_vulnerability_kind
-- PROJECT: Ahtc
-- DATE: 2021-03-10
-- VERSION: 1.01
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
UPDATE rec_equipment_state
SET vulnerability_kind_id = (SELECT ta_vulnerability_kind FROM pdm.pdm_vulnerability_kind WHERE rec_equipment_state.vulnerability_kind_id = pdm.pdm_vulnerability_kind.id);
COMMIT;
@@ -0,0 +1,25 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: drop PK and column id from pdm_vulnerability_kind and add PK on ta_vulnerability_kind
-- PROJECT: Ahtc
-- DATE: 2021-03-10
-- VERSION: 1.02
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
-- drop old primary key on column id
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP CONSTRAINT IF EXISTS PK_pdm_vulnerability_kind_id CASCADE;
-- drop column id
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP COLUMN IF EXISTS id CASCADE;
-- create new primary key on ta_vulnerability_kind
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP CONSTRAINT IF EXISTS PK_pdm_vulnerability_kind_ta_vulnerability_kind CASCADE;
ALTER TABLE IF EXISTS pdm_vulnerability_kind ADD CONSTRAINT PK_pdm_vulnerability_kind_ta_vulnerability_kind PRIMARY KEY (ta_vulnerability_kind);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+90
View File
@@ -0,0 +1,90 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: AES updates (enum, explosion single central table, recorded table and view)
-- PROJECT: Ahtc
-- DATE: 2021-03-12
-- VERSION: 1.03
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- enum
ALTER TABLE IF EXISTS aes_fuse_type DROP CONSTRAINT IF EXISTS PK_aes_fuse_type_id CASCADE;
DROP TABLE IF EXISTS aes_fuse_type CASCADE;
CREATE TABLE IF NOT EXISTS aes_fuse_type (
id integer,
name text
);
COMMENT ON TABLE aes_fuse_type IS 'static data (<b>not</b> project specific) generate from enum';
ALTER TABLE IF EXISTS aes_fuse_type ADD CONSTRAINT PK_aes_fuse_type_id PRIMARY KEY (id);
INSERT INTO aes_fuse_type (id, name) VALUES (0, 'FtProximity');
INSERT INTO aes_fuse_type (id, name) VALUES (1, 'FtImpact');
INSERT INTO aes_fuse_type (id, name) VALUES (2, 'FtDelay');
-- table aes_explosion_single_central
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS PK_aes_explosion_single_central_id CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS FK_aes_explosion_single_central_explosion_single_id_aes_explosi CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS FK_aes_explosion_single_central_fuse_type_id_aes_fuse_type_id CASCADE;
DROP TABLE IF EXISTS aes_explosion_single_central CASCADE;
CREATE SEQUENCE IF NOT EXISTS aes_explosion_single_central_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE TABLE IF NOT EXISTS aes_explosion_single_central (
id integer DEFAULT nextval(( 'aes_explosion_single_central_id_seq'::text)::regclass),
explosion_single_id integer,
angle double precision,
fuse_type_id integer
);
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT PK_aes_explosion_single_central_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT FK_aes_explosion_single_central_explosion_single_id_aes_explosi FOREIGN KEY (explosion_single_id) REFERENCES aes_explosion_single (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT FK_aes_explosion_single_central_fuse_type_id_aes_fuse_type_id FOREIGN KEY (fuse_type_id) REFERENCES aes_fuse_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
-- recorded table rec_explosion_single_central
ALTER TABLE IF EXISTS rec_explosion_single_central DROP CONSTRAINT IF EXISTS PK_rec_explosion_single_central_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_explosion_single_central DROP CONSTRAINT IF EXISTS IDX_rec_explosion_single_central_sample_time CASCADE;
DROP TABLE IF EXISTS rec_explosion_single_central CASCADE;
CREATE SEQUENCE IF NOT EXISTS rec_explosion_single_central_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE TABLE IF NOT EXISTS rec_explosion_single_central (
id integer,
name text,
is_deleted boolean,
is_used boolean,
sample_time bigint,
charge_type_id integer,
effect_duration integer,
effect_start bigint,
effect_state_id integer,
party_id integer,
participant_id integer,
effect_marking_in_ta boolean,
external_id bigint,
impact_position_lon double precision,
impact_position_lat double precision,
fire_request_time bigint,
altitude integer,
purpose text,
angle double precision,
fuse_type integer,
rec_id bigint DEFAULT nextval(( 'rec_explosion_single_central_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_explosion_single_central IS 'recorded data for topic ExplosionSingleCentral';
ALTER TABLE IF EXISTS rec_explosion_single_central ADD CONSTRAINT PK_rec_explosion_single_central_rec_id PRIMARY KEY (rec_id);
CREATE INDEX IDX_rec_explosion_single_central_sample_time ON rec_explosion_single_central (sample_time);
-- view aes_explosion_single_central_view
DROP VIEW IF EXISTS aes_explosion_single_central_view;
CREATE OR REPLACE VIEW aes_explosion_single_central_view AS SELECT aes_entity.id AS id, aes_entity.charge_type_id AS charge_type_id, aes_entity.effect_state_id AS effect_state_id, aes_entity.party_id AS party_id, aes_entity.participant_id AS participant_id, aes_entity.effect_duration AS effect_duration, aes_entity.effect_start AS effect_start, aes_entity.name AS name, aes_entity.effect_marking_in_ta AS effect_marking_in_ta, aes_entity.external_id AS external_id, aes_explosion.entity_id AS entity_id, aes_explosion.impact_position_x AS impact_position_x, aes_explosion.impact_position_y AS impact_position_y, aes_explosion.rotation_angle AS rotation_angle, aes_explosion.fire_purpose AS fire_purpose, aes_explosion.fire_request_time AS fire_request_time, aes_explosion.altitude AS altitude, aes_explosion_single.explosion_id AS explosion_id, aes_explosion_single_central.explosion_single_id AS explosion_single_id, aes_explosion_single_central.angle AS angle, aes_explosion_single_central.fuse_type_id AS fuse_type_id, aes_explosion_single_central.id AS aes_explosion_single_central_id
FROM aes_explosion_single_central, aes_entity, aes_explosion, aes_explosion_single
WHERE aes_entity.id = aes_explosion.entity_id AND
aes_explosion.id = aes_explosion_single.explosion_id AND
aes_explosion_single.id = aes_explosion_single_central.explosion_single_id;
COMMIT;
@@ -0,0 +1,42 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Added missing operator rights descriptions
-- PROJECT: Ahtc
-- DATE: 2021-02-22
-- VERSION: 1.04
-------------------------------------------------------------------------
-- GLOBAL: OPM;
BEGIN;
-- old right without description
UPDATE opm.opm_group SET description = 'Edit Charge Visibility' WHERE name = 'ChargeVisibilityEdit';
--UPDATE opm.opm_group SET description = 'SanNineLiner operator rights' WHERE name = 'SanNineLiner';
--UPDATE opm.opm_group SET description = 'Edit SanNineLiner' WHERE name = 'SanNineLinerEdit';
--UPDATE opm.opm_group SET description = 'Show SanNineLiner' WHERE name = 'SanNineLinerShow';
UPDATE opm.opm_group SET description = 'View Operational Plannings' WHERE name = 'OperationalPlanningView';
UPDATE opm.opm_group SET description = 'Administrator rights' WHERE name = 'Administrator';
UPDATE opm.opm_group SET description = 'Shut down workstations' WHERE name = 'ShutdownWorkstations';
UPDATE opm.opm_group SET description = 'Database Administration' WHERE name = 'DatabaseAdministration';
UPDATE opm.opm_group SET description = 'Change exercise state' WHERE name = 'ExerciseStateEdit';
UPDATE opm.opm_group SET description = 'Edit Codification Data' WHERE name = 'CodificationDataEdit';
UPDATE opm.opm_group SET description = 'Show Codification Data BLUFOR' WHERE name = 'CodificationDataShowBLUFOR';
UPDATE opm.opm_group SET description = 'Show Codification Data OPFOR' WHERE name = 'CodificationDataShowOPFOR';
UPDATE opm.opm_group SET description = 'Allow access to the voice communication channels' WHERE name = 'AvVoiceCommunicationAccess';
UPDATE opm.opm_group SET description = 'Edit Combat Net Radio Frequency Planning' WHERE name = 'FrequencyPlanningEdit';
--UPDATE opm.opm_group SET description = 'Show Guez Nasat Configuration' WHERE name = 'GuezNasatConfigurationShow';
--UPDATE opm.opm_group SET description = 'Edit Guez Nasat Configuration' WHERE name = 'GuezNasatConfigurationEdit';
-- new operator right for PvSan Reports
--INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (520159235, 'ReportsEditSan', 'Create and Edit PvSan Reports');
--INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (520093698, 'ReportsEditSan', 'Create and Edit PvSan Reports', 1, true);
--INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (520093698, 520159235); -- group_id is: 520093698 = 0x1f000002
--INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (520159232, 520093698); -- Reports
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,56 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM views, grant select on views to all users, export csv commented
-- PROJECT: Ahtc
-- DATE: 2021-03-22
-- VERSION: 1.05
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
DROP VIEW IF EXISTS ism.ism_mpa_barcodes;
CREATE OR REPLACE VIEW ism.ism_mpa_barcodes AS
SELECT asset_id, a.barcode AS asset_barcode, structure_element_id, se.barcode AS se_barcode, se.main_structure_element_id, mse.name
FROM ism.ism_mounting_point_asset mpa, ism.ism_asset a, ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE mpa.asset_id = a.id AND mpa.structure_element_id = se.id AND se.main_structure_element_id = mse.id AND mse.id > 300
AND length(a.barcode) > 0 AND length(se.barcode) > 0
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_mpa_barcodes) TO '/opt/postgres/backup/ism_mpa_barcodes.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_se_barcodes;
CREATE OR REPLACE VIEW ism.ism_se_barcodes AS
SELECT se.id,se.name,se.main_structure_element_id,mse.name as main_name,se.barcode
FROM ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE se.main_structure_element_id = mse.id AND length(se.barcode) > 0 AND mse.id > 300
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_se_barcodes WHERE main_structure_element_id > 300) TO '/opt/postgres/backup/ism_se_barcodes.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_view_plans;
CREATE OR REPLACE VIEW ism.ism_view_plans AS
SELECT mpp.id, mpp.mounting_point_schedule_id, mpp.structure_element_id, se.main_structure_element_id, se.name, mse.name as main_name
FROM ism.ism_mounting_point_plan mpp, ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE se.id = mpp.structure_element_id AND se.main_structure_element_id = mse.id AND mse.id > 300
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_view_plans) TO '/opt/postgres/backup/ism_view_plans.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_view_buildings;
CREATE OR REPLACE VIEW ism.ism_view_buildings AS
SELECT se.id AS se_id, se.main_structure_element_id AS bldg_id, mse.model_id, se.display_name, se.barcode AS se_barcode, se.rel_position_x, se.rel_position_y, se.rel_position_z, mpt.name AS mp_type, mpa.asset_id, at.barcode AS asset_barcode
FROM ism.ism_mounting_point_type mpt, ism.ism_main_structure_element mse, ism.ism_structure_element se LEFT OUTER JOIN ism.ism_mounting_point_asset mpa ON se.id = mpa.structure_element_id
LEFT OUTER JOIN ism.ism_asset at ON mpa.asset_id = at.id
WHERE se.mounting_point_type_id = mpt.id AND se.main_structure_element_id = mse.id
ORDER BY se.main_structure_element_id, se.id;
-- COPY (SELECT * from ism.ism_view_buildings) TO '/opt/postgres/backup/ism_view_buildings.csv' DELIMITER ',' CSV HEADER;
-- grant select on views to all users
GRANT SELECT ON ALL TABLES IN SCHEMA ism TO ets_ro;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,27 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! add column sanitation_unique_id, drop column procedures_needed, change type for procedures_taken as bigint.
-- PROJECT: Ahtc
-- DATE: 2021-03-22
-- VERSION: 1.06
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
ALTER TABLE IF EXISTS rec_dynamic_participant_data ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rep_sanitation_material_data ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rep_sanitation_material_result ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rec_participant_sanitation ADD COLUMN IF NOT EXISTS sanitation_result integer;
ALTER TABLE IF EXISTS rec_participant_sanitation DROP COLUMN IF EXISTS procedures_needed;
ALTER TABLE IF EXISTS rec_participant_sanitation ADD COLUMN IF NOT EXISTS procedures_taken bigint;
ALTER TABLE IF EXISTS rec_participant_sanitation ALTER COLUMN procedures_taken TYPE bigint;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update values in PDM building charge effect
-- PROJECT: Ahtc
-- DATE: 2021-03-23
-- VERSION: 1.07
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! New Sanitation Procedures in PDM, changes in EX rec_sanitation, new sanitation materials
-- PROJECT: Ahtc
-- DATE: 2021-05-18
-- VERSION: 1.08
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: new columns originator_building_id and originator_room_id in recorded table rec_hit_line_info (SVN 53507)
-- PROJECT: Ahtc
-- DATE: 2021-05-27
-- VERSION: 1.09
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_hit_line_info ADD COLUMN IF NOT EXISTS originator_building_id INTEGER;
ALTER TABLE IF EXISTS rec_hit_line_info ADD COLUMN IF NOT EXISTS originator_room_id INTEGER;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Fixes NLDEVCTRL-925 (RPL Nr 728: MunCode falsch)
-- PROJECT: Ahtc
-- DATE: 2021-06-21
-- VERSION: 1.10
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+23
View File
@@ -0,0 +1,23 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add role ctc_sv (backwords compatibility, used for MBA)
-- PROJECT: Ahtc
-- DATE: 2021-06-22
-- VERSION: 1.11
-------------------------------------------------------------------------
-- GLOBAL: PUBLIC;
BEGIN;
-- For Convenience (Backwards Usability)
--CREATE USER ctc PASSWORD 'ctc11de' CREATEROLE;
CREATE USER ctc_sv PASSWORD 'ctc11de' CREATEROLE;
--CREATE USER ctc_ws PASSWORD 'ctc11de' CREATEROLE;
GRANT ets_ro TO ctc, ctc_sv;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+19
View File
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Added column Name to ISM MPA (SVN 53407)
-- PROJECT: Ahtc
-- DATE: 2021-06-22
-- VERSION: 1.12
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
ALTER TABLE ism_mounting_point_asset ADD COLUMN name text;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,40 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add table egcu_relay_info in ASM (SVN 53346)
-- PROJECT: Ahtc
-- DATE: 2021-06-22
-- VERSION: 1.13
-------------------------------------------------------------------------
-- GLOBAL: ASM;
BEGIN;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS PK_asm_egcu_relay_info_id CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_id CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_name CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_relay_id CASCADE;
DROP TABLE IF EXISTS asm_egcu_relay_info CASCADE;
CREATE TABLE IF NOT EXISTS asm_egcu_relay_info (
id integer DEFAULT nextval(( 'asm.asm_egcu_relay_info_id_seq'::text)::regclass),
relay_id integer, -- Index of Relay
name text, -- Name of relay
description text, -- description of relay
properties text -- properties of relay
);
COMMENT ON TABLE asm_egcu_relay_info IS 'EGCU-Relay-Names';
COMMENT ON COLUMN asm_egcu_relay_info.relay_id IS 'Index of Relay';
COMMENT ON COLUMN asm_egcu_relay_info.name IS 'Name of relay';
COMMENT ON COLUMN asm_egcu_relay_info.description IS 'description of relay';
COMMENT ON COLUMN asm_egcu_relay_info.properties IS 'properties of relay';
CREATE SEQUENCE IF NOT EXISTS asm_egcu_relay_info_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS asm_egcu_relay_info ADD CONSTRAINT PK_asm_egcu_relay_info_id PRIMARY KEY (id);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_id UNIQUE (id);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_name UNIQUE (name);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_relay_id UNIQUE (relay_id);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,53 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add table bcu_egcu_relay_infos in Exercise BLD (SVN 53304, 53573)
-- PROJECT: Ahtc
-- DATE: 2021-06-23
-- VERSION: 1.14
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- Drop tables/views/sequences/constraints
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS PK_bcu_egcu_relay_infos_id CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_id CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_index CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_name CASCADE;
DROP TABLE IF EXISTS bcu_egcu_relay_infos CASCADE;
-- Create tables
CREATE TABLE IF NOT EXISTS bcu_egcu_relay_infos (
id integer DEFAULT nextval(( 'bcu_egcu_relay_infos_id_seq'::text)::regclass),
asset_id bigint, -- 0 = default for all EGCUs &gt, 0 = assetId for special entries
index integer DEFAULT nextval(( 'bcu_egcu_relay_infos_index_seq'::text)::regclass), -- Index of Relay
name text, -- Name of relay
description text, -- description of relay
properties text -- properties of relay
);
COMMENT ON TABLE bcu_egcu_relay_infos IS 'EGCU-Relay-Names';
COMMENT ON COLUMN bcu_egcu_relay_infos.asset_id IS '0 = default for all EGCUs &gt, 0 = assetId for special entries';
COMMENT ON COLUMN bcu_egcu_relay_infos.index IS 'Index of Relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.name IS 'Name of relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.description IS 'description of relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.properties IS 'properties of relay';
-- Create sequence(s)
CREATE SEQUENCE IF NOT EXISTS bcu_egcu_relay_infos_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS bcu_egcu_relay_infos_index_seq INCREMENT 1 START 0 MINVALUE 0;
-- Create primary keys
ALTER TABLE IF EXISTS bcu_egcu_relay_infos ADD CONSTRAINT PK_bcu_egcu_relay_infos_id PRIMARY KEY (id);
-- Indexes
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_id UNIQUE (id);
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_index UNIQUE (index);
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_name UNIQUE (name);
COMMIT;
@@ -0,0 +1,23 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add values in table asm.egcu_relay_info (SVN 53405)
-- PROJECT: Ahtc
-- DATE: 2021-06-23
-- VERSION: 1.15
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
-- EGCU Relay Infos Note: Description and Properties available but unused, Don't insert unused relays!
--INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name) VALUES (1, 0, 'Lampe');
--INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name) VALUES (2, 1, 'Heizung');
--INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name, properties) VALUES (3, 2, 'Nebel', '{"allowPermanentOn":false}');
--ALTER SEQUENCE asm.asm_egcu_relay_info_id_seq RESTART WITH 4;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update values in PDM (SVN 53828) - gear_type_charge_type, building_charge_effect, charge_type Nebel
-- PROJECT: Ahtc
-- DATE: 2021-03-25
-- VERSION: 1.16
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,28 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! New operator rights EgcuMonitorShow and EgcuRoomsEdit
-- PROJECT: Ahtc
-- DATE: 2021-06-29
-- VERSION: 1.17
-------------------------------------------------------------------------
-- GLOBAL: OPM;
BEGIN;
--- Base: 738263040, EgcuMonitorShow - 738263047 = 0x2c010007
INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (738263047, 'EgcuMonitorShow', 'Show EgcuMonitor');
INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (738197509, 'EgcuMonitorShow', 'Show EgcuMonitor', 1, true);
INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (738197509, 738263047); -- group_id is: 738197509 = 0x2c000005
INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (738263040, 738197509); -- Service Monitors - Participants
--- Base: 738263040, EgcuRoomsEdit - 738263048 = 0x2c010008
INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (738263048, 'EgcuRoomsEdit', 'Edit the rooms belonging to one segment.');
INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (738197510, 'EgcuRoomsEdit', 'Edit the rooms belonging to one segment.', 1, true);
INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (738197510, 738263048); -- group_id is: 738197510 = 0x2c000006
INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (738263040, 738197510); -- Service Monitors - Participants
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update dis_entity in PDM and generate codes 2xxx, 4xxx etc.
-- PROJECT: Ahtc
-- DATE: 2021-07-26
-- VERSION: 1.18
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update PDM Gear Type fr Puma
-- PROJECT: Ahtc
-- DATE: 2021-08-09
-- VERSION: 1.19
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: new indexes on eem_event table (on sample_time and event_type) to optimize search (SVN 54364)
-- PROJECT: Ahtc
-- DATE: 2021-08-12
-- VERSION: 1.20
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
CREATE INDEX IDX_eem_event_sample_time ON eem_event (sample_time);
CREATE INDEX IDX_eem_event_event_type_id ON eem_event (event_type_id);
COMMIT;
@@ -0,0 +1,38 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM and EX BLD Bridge modifications
-- PROJECT: Ahtc
-- DATE: 2021-08-17
-- VERSION: 1.21
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
INSERT INTO ism_structure_element_type (id, name) VALUES (11, 'Bridge');
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_bridge_status DROP CONSTRAINT IF EXISTS PK_rec_bridge_status_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_bridge_status DROP CONSTRAINT IF EXISTS IDX_rec_bridge_status_sample_time CASCADE;
DROP TABLE IF EXISTS rec_bridge_status CASCADE;
CREATE TABLE IF NOT EXISTS rec_bridge_status (
id integer,
name text,
is_deleted boolean,
is_used boolean,
sample_time bigint,
building_id integer,
status integer,
rec_id bigint DEFAULT nextval(( 'rec_bridge_status_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_bridge_status IS 'recorded data for topic BridgeStatus';
CREATE SEQUENCE IF NOT EXISTS rec_bridge_status_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS rec_bridge_status ADD CONSTRAINT PK_rec_bridge_status_rec_id PRIMARY KEY (rec_id);
CREATE INDEX IDX_rec_bridge_status_sample_time ON rec_bridge_status (sample_time);
COMMIT;
@@ -0,0 +1,106 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM changes from Resource Management branch
-- PROJECT: Ahtc
-- DATE: 2021-08-17
-- VERSION: 1.22
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
ALTER TABLE IF EXISTS ism_mounting_point_plan DROP CONSTRAINT IF EXISTS FK_ism_mounting_point_plan_mounting_point_state_ism_mounting_po CASCADE;
ALTER TABLE IF EXISTS ism_mounting_point_schedule DROP CONSTRAINT IF EXISTS FK_ism_mounting_point_schedule_status_id_ism_schedule_status_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status DROP CONSTRAINT IF EXISTS PK_ism_schedule_status_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS PK_ism_schedule_status_change_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS FK_ism_schedule_status_change_schedule_id_ism_mounting_point_sc CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS FK_ism_schedule_status_change_schedule_status_id_ism_schedule_s CASCADE;
DROP TABLE IF EXISTS ism_schedule_status CASCADE;
DROP TABLE IF EXISTS ism_schedule_status_change CASCADE;
CREATE TABLE IF NOT EXISTS ism_schedule_status (
id integer DEFAULT nextval(( 'ism.ism_schedule_status_id_seq'::text)::regclass),
name text
);
CREATE TABLE IF NOT EXISTS ism_schedule_status_change (
id integer DEFAULT nextval(( 'ism.ism_schedule_status_change_id_seq'::text)::regclass),
schedule_id integer,
schedule_status_id integer,
changed_at bigint,
operator_id integer,
workstation_id integer
);
COMMENT ON TABLE ism_schedule_status_change IS 'instrumentation plan status changes';
ALTER TABLE ism_mounting_point_plan ADD COLUMN IF NOT EXISTS mounting_point_state integer DEFAULT 0;
COMMENT ON COLUMN ism_mounting_point_plan.mounting_point_state IS '(-1, 0, 1) - (Empty, Idle, Equipped)';
DELETE FROM ism_mounting_point_state WHERE id = -1;
INSERT INTO ism_mounting_point_state (id, name) VALUES (-1, 'Empty');
INSERT INTO ism_schedule_status (id, name) VALUES (0, 'Unknown');
INSERT INTO ism_schedule_status (id, name) VALUES (1, 'Created');
INSERT INTO ism_schedule_status (id, name) VALUES (2, 'Prepared');
INSERT INTO ism_schedule_status (id, name) VALUES (3, 'Activated');
INSERT INTO ism_schedule_status (id, name) VALUES (4, 'Expired');
INSERT INTO ism_schedule_status (id, name) VALUES (5, 'Removed');
CREATE SEQUENCE IF NOT EXISTS ism_schedule_status_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS ism_schedule_status_change_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS ism_schedule_status ADD CONSTRAINT PK_ism_schedule_status_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS ism_schedule_status_change ADD CONSTRAINT PK_ism_schedule_status_change_id PRIMARY KEY (id);
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS status_id INTEGER;
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS time_created bigint DEFAULT (extract(epoch from now()) * 1000);
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS time_prepared bigint;
COMMENT ON COLUMN ism_mounting_point_schedule.time_start IS 'time activated';
COMMENT ON COLUMN ism_mounting_point_schedule.time_end IS 'time expired';
ALTER TABLE ism_mounting_point_schedule ADD CONSTRAINT FK_ism_mounting_point_schedule_status_id_ism_schedule_status_id FOREIGN KEY (status_id) REFERENCES ism_schedule_status (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_schedule_status_change ADD CONSTRAINT FK_ism_schedule_status_change_schedule_id_ism_mounting_point_sc FOREIGN KEY (schedule_id) REFERENCES ism_mounting_point_schedule (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_schedule_status_change ADD CONSTRAINT FK_ism_schedule_status_change_schedule_status_id_ism_schedule_s FOREIGN KEY (schedule_status_id) REFERENCES ism_schedule_status (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_mounting_point_plan ADD CONSTRAINT FK_ism_mounting_point_plan_mounting_point_state_ism_mounting_po FOREIGN KEY (mounting_point_state) REFERENCES ism_mounting_point_state (id) ON DELETE CASCADE ON UPDATE CASCADE;
-- DROP INDEX IF EXISTS IDX_ism_mounting_point_plan_mounting_point_schedule_id CASCADE;
CREATE INDEX IF NOT EXISTS IDX_ism_mounting_point_plan_mounting_point_schedule_id ON ism_mounting_point_plan (mounting_point_schedule_id);
UPDATE ism_mounting_point_schedule SET status_id = 1 WHERE status_id IS null;
-- Notify functions for callbacks (signals in db interface) - needed for copySchedule
CREATE OR REPLACE FUNCTION public.ism_notifyInsertMainSchedule()
RETURNS TRIGGER AS $$
DECLARE
toNotify RECORD;
toReturn RECORD;
BEGIN
IF (TG_OP = 'INSERT') THEN
toNotify = NEW;
toReturn = NEW;
ELSIF (TG_OP = 'UPDATE') THEN
toNotify = OLD;
toReturn = NEW;
ELSIF (TG_OP = 'DELETE') THEN
toNotify = OLD;
toReturn = OLD;
END IF;
PERFORM pg_notify('notifyInsertMainSchedule', CAST(toNotify.id AS text));
RETURN toReturn;
END;
$$ LANGUAGE plpgsql;
-- Notify function trigger for callbacks (signals in db interface) - needed for copySchedule
DROP TRIGGER IF EXISTS trg_ai_notifyInsertMainSchedule ON ism_mounting_point_schedule;
CREATE TRIGGER trg_ai_notifyInsertMainSchedule
AFTER INSERT ON ism_mounting_point_schedule FOR EACH ROW EXECUTE PROCEDURE public.ism_notifyInsertMainSchedule();
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add 6 Guez bridges with footprints
-- PROJECT: Ahtc
-- DATE: 2021-09-03
-- VERSION: 1.23
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Puma VBA changes
-- PROJECT: Ahtc
-- DATE: 2021-08-26
-- VERSION: 1.24
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Disentities for all charge types
-- PROJECT: Ahtc
-- DATE: 2021-08-27
-- VERSION: 1.25
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+19
View File
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add MP type BuildingNetworkSwitch and delete double entries from assets
-- PROJECT: Ahtc
-- DATE: 2021-09-16
-- VERSION: 1.26
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
INSERT INTO ism.ism_mounting_point_type (id, name) VALUES (14, 'BuildingNetworkSwitch');
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add values with icons in table asm.egcu_relay_info (NLDEVCTRL-1333)
-- PROJECT: Ahtc
-- DATE: 2021-09-16
-- VERSION: 1.27
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update values in pdm_gear_type_charge_type (NLDEVCTRL-926)
-- PROJECT: Ahtc
-- DATE: 2021-09-17
-- VERSION: 1.28
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Update display names for buildings and mounting points (for streams) by removing "bldg_"
-- PROJECT: Ahtc
-- DATE: 2021-09-26
-- VERSION: 1.29
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
--# $Id$
--# $HeadURL$
--# $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Move OutdoorIPS (6) to IndoorIPS (5)
-- PROJECT: Ahtc
-- DATE: 2021-09-21
-- VERSION: 1.30
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+14
View File
@@ -0,0 +1,14 @@
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Clean up FLM
-- PROJECT: Ahtc
-- DATE: 2021-09-23
-- VERSION: 1.31
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,14 @@
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Insert missing folder structure for ex 130 (phase 141)
-- PROJECT: Ahtc
-- DATE: 2021-09-24
-- VERSION: 1.32
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Add back Nebel Mrt (385) in pdm_gear_type_charge_type and also in exercise charge administration table
-- PROJECT: Ahtc
-- DATE: 2021-09-24
-- VERSION: 1.33
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+18
View File
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! clean events: remove AVS event with no streamName, remove duplicates. Clean pdm_event_type.
-- PROJECT: Ahtc
-- DATE: 2021-09-29
-- VERSION: 1.34
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,26 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: add column qualification in old exercises
-- PROJECT: Ahtc
-- DATE: 2021-11-10
-- VERSION: 1.35
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- PPM
ALTER TABLE IF EXISTS rec_dynamic_participant_data ADD COLUMN IF NOT EXISTS qualification integer;
UPDATE rec_dynamic_participant_data SET qualification = 1 WHERE qualification IS NULL;
-- REP
ALTER TABLE IF EXISTS rep_sanitation_material_data ADD COLUMN IF NOT EXISTS qualification integer;
ALTER TABLE IF EXISTS rep_sanitation_material_result ADD COLUMN IF NOT EXISTS qualification integer;
UPDATE rep_sanitation_material_data SET qualification = 1 WHERE qualification IS NULL;
UPDATE rep_sanitation_material_result SET qualification = 1 WHERE qualification IS NULL;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! update values in PDM building charge effect (SVN 55598)
-- PROJECT: Ahtc
-- DATE: 2021-11-15
-- VERSION: 1.36
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,18 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! New equipment type and 2 types for Patient Simulation
-- PROJECT: Ahtc
-- DATE: 2021-11-25
-- VERSION: 1.37
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,47 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------------------
-- INFO: New columns in AES impact_position_z and source_position x,y,z (BRANCH 3DWS!)
-- PROJECT: Ahtc
-- DATE: 2021-12-07
-- VERSION: 1.38
------------------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS aes_explosion ADD COLUMN IF NOT EXISTS impact_position_z DOUBLE PRECISION;
ALTER TABLE IF EXISTS rec_explosion_single ADD COLUMN IF NOT EXISTS impact_position_z DOUBLE PRECISION;
ALTER TABLE IF EXISTS aes_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_x DOUBLE PRECISION;
ALTER TABLE IF EXISTS aes_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_y DOUBLE PRECISION;
ALTER TABLE IF EXISTS aes_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_y DOUBLE PRECISION;
ALTER TABLE IF EXISTS rec_explosion_single_central ADD COLUMN IF NOT EXISTS impact_position_z DOUBLE PRECISION;
ALTER TABLE IF EXISTS rec_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_x DOUBLE PRECISION;
ALTER TABLE IF EXISTS rec_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_y DOUBLE PRECISION;
ALTER TABLE IF EXISTS rec_explosion_single_central ADD COLUMN IF NOT EXISTS source_position_y DOUBLE PRECISION;
CREATE OR REPLACE VIEW aes_explosion_area_view AS SELECT aes_entity.id AS id, aes_entity.charge_type_id AS charge_type_id, aes_entity.effect_state_id AS effect_state_id, aes_entity.party_id AS party_id, aes_entity.participant_id AS participant_id, aes_entity.effect_duration AS effect_duration, aes_entity.effect_start AS effect_start, aes_entity.name AS name, aes_entity.effect_marking_in_ta AS effect_marking_in_ta, aes_entity.external_id AS external_id, aes_explosion.entity_id AS entity_id, aes_explosion.impact_position_x AS impact_position_x, aes_explosion.impact_position_y AS impact_position_y, aes_explosion.rotation_angle AS rotation_angle, aes_explosion.fire_purpose AS fire_purpose, aes_explosion.fire_request_time AS fire_request_time, aes_explosion.altitude AS altitude, aes_explosion.impact_position_z AS impact_position_z, aes_explosion_area.explosion_id AS explosion_id, aes_explosion_area.impact_width AS impact_width, aes_explosion_area.impact_length AS impact_length, aes_explosion_area.cannon_count AS cannon_count, aes_explosion_area.cannon_rounds AS cannon_rounds, aes_explosion_area.original_effect_start AS original_effect_start, aes_explosion_area.original_effect_duration AS original_effect_duration, aes_explosion_area.remain_explosion_number AS remain_explosion_number, aes_explosion_area.id AS aes_explosion_area_id
FROM aes_explosion_area, aes_entity, aes_explosion
WHERE aes_entity.id = aes_explosion.entity_id AND
aes_explosion.id = aes_explosion_area.explosion_id;
CREATE OR REPLACE VIEW aes_explosion_single_view AS SELECT aes_entity.id AS id, aes_entity.charge_type_id AS charge_type_id, aes_entity.effect_state_id AS effect_state_id, aes_entity.party_id AS party_id, aes_entity.participant_id AS participant_id, aes_entity.effect_duration AS effect_duration, aes_entity.effect_start AS effect_start, aes_entity.name AS name, aes_entity.effect_marking_in_ta AS effect_marking_in_ta, aes_entity.external_id AS external_id, aes_explosion.entity_id AS entity_id, aes_explosion.impact_position_x AS impact_position_x, aes_explosion.impact_position_y AS impact_position_y, aes_explosion.rotation_angle AS rotation_angle, aes_explosion.fire_purpose AS fire_purpose, aes_explosion.fire_request_time AS fire_request_time, aes_explosion.altitude AS altitude, aes_explosion.impact_position_z AS impact_position_z, aes_explosion_single.explosion_id AS explosion_id, aes_explosion_single.id AS aes_explosion_single_id
FROM aes_explosion_single, aes_entity, aes_explosion
WHERE aes_entity.id = aes_explosion.entity_id AND
aes_explosion.id = aes_explosion_single.explosion_id;
CREATE OR REPLACE VIEW aes_explosion_single_central_view AS SELECT aes_entity.id AS id, aes_entity.charge_type_id AS charge_type_id, aes_entity.effect_state_id AS effect_state_id, aes_entity.party_id AS party_id, aes_entity.participant_id AS participant_id, aes_entity.effect_duration AS effect_duration, aes_entity.effect_start AS effect_start, aes_entity.name AS name, aes_entity.effect_marking_in_ta AS effect_marking_in_ta, aes_entity.external_id AS external_id, aes_explosion.entity_id AS entity_id, aes_explosion.impact_position_x AS impact_position_x, aes_explosion.impact_position_y AS impact_position_y, aes_explosion.rotation_angle AS rotation_angle, aes_explosion.fire_purpose AS fire_purpose, aes_explosion.fire_request_time AS fire_request_time, aes_explosion.altitude AS altitude, aes_explosion.impact_position_z AS impact_position_z, aes_explosion_single.explosion_id AS explosion_id, aes_explosion_single_central.explosion_single_id AS explosion_single_id, aes_explosion_single_central.angle AS angle, aes_explosion_single_central.fuse_type_id AS fuse_type_id, aes_explosion_single_central.source_position_x AS source_position_x, aes_explosion_single_central.source_position_y AS source_position_y, aes_explosion_single_central.source_position_z AS source_position_z, aes_explosion_single_central.id AS aes_explosion_single_central_id
FROM aes_explosion_single_central, aes_entity, aes_explosion, aes_explosion_single
WHERE aes_entity.id = aes_explosion.entity_id AND
aes_explosion.id = aes_explosion_single.explosion_id AND
aes_explosion_single.id = aes_explosion_single_central.explosion_single_id;
COMMIT;
@@ -0,0 +1,23 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Properties column for Type and Participant
-- PROJECT: Ahtc
-- DATE: 2021-12-14
-- VERSION: 1.39
-------------------------------------------------------------------------
-- GLOBAL: PPM;
BEGIN;
ALTER TABLE IF EXISTS ppm_type ADD COLUMN IF NOT EXISTS properties jsonb;
ALTER TABLE IF EXISTS ppm_participant ADD COLUMN IF NOT EXISTS properties jsonb;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS ppm_participant ADD COLUMN IF NOT EXISTS properties jsonb;
-- in recorded topic is text
ALTER TABLE IF EXISTS rec_participant ADD COLUMN IF NOT EXISTS properties text;
COMMIT;
+19
View File
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Increase EXM.exercise sequence so it does not overlap existing exercises in Warehouse
-- PROJECT: Ahtc
-- DATE: 2022-01-13
-- VERSION: 1.40
-------------------------------------------------------------------------
-- GLOBAL: EXM;
BEGIN;
ALTER SEQUENCE exm.exercise_id_seq RESTART WITH 200;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,77 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add missing CTC workstations
-- PROJECT: Ahtc
-- DATE: 2022-02-08
-- VERSION: 1.41
-------------------------------------------------------------------------
-- GLOBAL: ASM;
BEGIN;
-- CTC Auditorium
INSERT INTO asm.asm_asset(id, name, asset_type_id, location_id) VALUES
(165, 'ECAA1WS01', 1, 6);
-- CTC AAR Workstations
INSERT INTO asm.asm_asset(id, name, asset_type_id, location_id) VALUES
(166, 'ECAA2WS01', 1, 6),
(167, 'ECAA2WS02', 1, 6);
-- CTC O/C Tablets - LAN
INSERT INTO asm.asm_asset(id, name, asset_type_id, location_id) VALUES
(201, 'ECCTANB01GB', 1, 6),
(202, 'ECCTANB02GB', 1, 6),
(203, 'ECCTANB03GB', 1, 6),
(204, 'ECCTANB04GB', 1, 6),
(205, 'ECCTANB05GB', 1, 6),
(206, 'ECCTANB06GB', 1, 6),
(207, 'ECCTANB07GB', 1, 6),
-- (208, 'ECCTANB08GB', 1, 6), -- already in DB with id 170
(209, 'ECCTANB09GB', 1, 6),
(210, 'ECCTANB10GB', 1, 6),
(211, 'ECCTANB11GB', 1, 6),
(212, 'ECCTANB12GB', 1, 6),
(213, 'ECCTANB13GB', 1, 6),
(214, 'ECCTANB14GB', 1, 6),
(215, 'ECCTANB15GB', 1, 6),
(216, 'ECCTANB16GB', 1, 6),
(217, 'ECCTANB17GB', 1, 6),
(218, 'ECCTANB18GB', 1, 6),
(219, 'ECCTANB19GB', 1, 6),
(220, 'ECCTANB20GB', 1, 6);
UPDATE asm.asm_asset SET id = 208 where id = 170;
-- CTC O/C Tablets - WIFI
INSERT INTO asm.asm_asset(id, name, asset_type_id, location_id) VALUES
(221, 'ECCTANB01', 1, 6),
(222, 'ECCTANB02', 1, 6),
(223, 'ECCTANB03', 1, 6),
(224, 'ECCTANB04', 1, 6),
(225, 'ECCTANB05', 1, 6),
(226, 'ECCTANB06', 1, 6),
(227, 'ECCTANB07', 1, 6),
(228, 'ECCTANB08', 1, 6),
(229, 'ECCTANB09', 1, 6),
(230, 'ECCTANB10', 1, 6),
(231, 'ECCTANB11', 1, 6),
(232, 'ECCTANB12', 1, 6),
(233, 'ECCTANB13', 1, 6),
(234, 'ECCTANB14', 1, 6),
(235, 'ECCTANB15', 1, 6),
(236, 'ECCTANB16', 1, 6),
(237, 'ECCTANB17', 1, 6),
(238, 'ECCTANB18', 1, 6),
(239, 'ECCTANB19', 1, 6),
(240, 'ECCTANB20', 1, 6);
ALTER SEQUENCE asm.asm_asset_id_seq RESTART WITH 300;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,32 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Dis_Entities in Pdm_charge_type
-- PROJECT: Ahtc
-- DATE: 2022-02-09
-- VERSION: 1.42
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.9.225.2.3.1.0', properties = '{"impactRadius":4}' WHERE id = 44;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.9.225.2.21.1.0', properties = '{"impactRadius":20}' WHERE id = 42;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.9.225.2.21.3.0', properties = '{"impactRadius":20}' WHERE id = 43;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.9.225.2.21.0.0', properties = '{"impactRadius":20}' WHERE id = 45;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.2.225.1.3.5.1', properties = '{"impactRadius":10}' WHERE id = 46;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.2.225.1.3.5.2', properties = '{"impactRadius":10}' WHERE id = 47;
UPDATE pdm.pdm_charge_type SET dis_entity = '2.1.222.1.30.0.0', properties = '{"impactRadius":10}' WHERE id = 25;
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1097, 42);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1097, 43);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1097, 45);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1098, 44);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1099, 46);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id) VALUES ( 1099, 47);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,39 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: add columns (vitality, time_vitality, area_id, area_name) in rep_treament_data and rep_treatment_result
-- PROJECT: Ahtc
-- DATE: 2022-02-16
-- VERSION: 1.43
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS vitality INTEGER;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS vitality INTEGER;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS time_vitality BIGINT;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS time_vitality BIGINT;
UPDATE rep_treatment_data SET vitality = 100 WHERE vitality IS NULL;
UPDATE rep_treatment_result SET vitality = 100 WHERE vitality IS NULL;
UPDATE rep_treatment_data SET time_vitality = time_vulnerability WHERE time_vitality IS NULL OR (time_vitality = 0 AND time_vulnerability > 0);
UPDATE rep_treatment_result SET time_vitality = time_vulnerability WHERE time_vitality IS NULL OR (time_vitality = 0 AND time_vulnerability > 0);
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS area_id INTEGER;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS area_id INTEGER;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS area_name TEXT;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS area_name TEXT;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS area_name TEXT;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS area_name TEXT;
COMMIT;
@@ -0,0 +1,108 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add REP event type enum and new treatment timeline tables
-- PROJECT: Ahtc
-- DATE: 2022-02-21
-- VERSION: 2.01
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
DELETE FROM rep_report_type WHERE id = 18;
INSERT INTO rep_report_type (id, name) VALUES (18, 'TreatmentTimeline');
ALTER TABLE IF EXISTS rep_event_type DROP CONSTRAINT IF EXISTS PK_rep_event_type_id CASCADE;
DROP TABLE IF EXISTS rep_event_type CASCADE;
CREATE SEQUENCE IF NOT EXISTS rep_event_type_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE TABLE IF NOT EXISTS rep_event_type (
id integer DEFAULT nextval(( 'rep_event_type_id_seq'::text)::regclass),
name text
);
ALTER TABLE IF EXISTS rep_event_type ADD CONSTRAINT PK_rep_event_type_id PRIMARY KEY (id);
DELETE FROM rep_event_type;
INSERT INTO rep_event_type (id, name) VALUES (1, 'VBGChanged');
INSERT INTO rep_event_type (id, name) VALUES (2, 'VitalityChanged');
INSERT INTO rep_event_type (id, name) VALUES (3, 'NineLinerSet');
INSERT INTO rep_event_type (id, name) VALUES (4, 'DCUConnected');
INSERT INTO rep_event_type (id, name) VALUES (5, 'FirstTreatment');
INSERT INTO rep_event_type (id, name) VALUES (6, 'Treatment');
INSERT INTO rep_event_type (id, name) VALUES (7, 'TransportInitiated');
INSERT INTO rep_event_type (id, name) VALUES (8, 'EnterFunctionalArea');
INSERT INTO rep_event_type (id, name) VALUES (9, 'PositionChanged');
INSERT INTO rep_event_type (id, name) VALUES (10,'VitalityReset');
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS PK_rep_treatment_timeline_data_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_data_event_type_id_rep_event_type_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_data_party_id_ppm_party_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_data_participant_id_ppm_participant_i CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_data_participant_type_id_ppm_type_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_data DROP CONSTRAINT IF EXISTS UQ_rep_treatment_timeline_data_party_id_participant_type_id_par CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS PK_rep_treatment_timeline_result_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_result_event_type_id_rep_event_type_i CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_result_report_id_rep_report_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_result_participant_id_ppm_participant CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS FK_rep_treatment_timeline_result_participant_type_id_ppm_type_i CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS IDX_rep_treatment_timeline_result_report_id CASCADE;
ALTER TABLE IF EXISTS rep_treatment_timeline_result DROP CONSTRAINT IF EXISTS UQ_rep_treatment_timeline_result_report_id_participant_id_event CASCADE;
DROP TABLE IF EXISTS rep_treatment_timeline_data CASCADE;
DROP TABLE IF EXISTS rep_treatment_timeline_result CASCADE;
CREATE TABLE IF NOT EXISTS rep_treatment_timeline_data (
id bigint DEFAULT nextval(( 'rep_treatment_timeline_data_id_seq'::text)::regclass),
party_id integer,
participant_type_id integer,
participant_id integer,
event_type_id integer,
event_time bigint,
vulnerability integer,
vitality integer,
properties jsonb
);
CREATE TABLE IF NOT EXISTS rep_treatment_timeline_result (
id bigint DEFAULT nextval(( 'rep_treatment_timeline_result_id_seq'::text)::regclass),
report_id bigint,
participant_type_id integer,
participant_id integer,
participant_name text,
participant_equipment_number integer,
event_type_id integer,
event_time bigint,
vulnerability integer,
vitality integer,
properties jsonb
);
CREATE SEQUENCE IF NOT EXISTS rep_treatment_timeline_data_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS rep_treatment_timeline_result_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS rep_treatment_timeline_data ADD CONSTRAINT PK_rep_treatment_timeline_data_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS rep_treatment_timeline_result ADD CONSTRAINT PK_rep_treatment_timeline_result_id PRIMARY KEY (id);
ALTER TABLE rep_treatment_timeline_data ADD CONSTRAINT FK_rep_treatment_timeline_data_event_type_id_rep_event_type_id FOREIGN KEY (event_type_id) REFERENCES rep_event_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_data ADD CONSTRAINT FK_rep_treatment_timeline_data_party_id_ppm_party_id FOREIGN KEY (party_id) REFERENCES ppm_party (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_data ADD CONSTRAINT FK_rep_treatment_timeline_data_participant_id_ppm_participant_i FOREIGN KEY (participant_id) REFERENCES ppm_participant (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_data ADD CONSTRAINT FK_rep_treatment_timeline_data_participant_type_id_ppm_type_id FOREIGN KEY (participant_type_id) REFERENCES ppm.ppm_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_result ADD CONSTRAINT FK_rep_treatment_timeline_result_event_type_id_rep_event_type_i FOREIGN KEY (event_type_id) REFERENCES rep_event_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_result ADD CONSTRAINT FK_rep_treatment_timeline_result_report_id_rep_report_id FOREIGN KEY (report_id) REFERENCES rep_report (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_result ADD CONSTRAINT FK_rep_treatment_timeline_result_participant_id_ppm_participant FOREIGN KEY (participant_id) REFERENCES ppm_participant (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_result ADD CONSTRAINT FK_rep_treatment_timeline_result_participant_type_id_ppm_type_i FOREIGN KEY (participant_type_id) REFERENCES ppm.ppm_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE rep_treatment_timeline_data ADD CONSTRAINT UQ_rep_treatment_timeline_data_party_id_participant_type_id_par UNIQUE (party_id, participant_type_id, participant_id, event_time, event_type_id);
CREATE INDEX IDX_rep_treatment_timeline_result_report_id ON rep_treatment_timeline_result (report_id);
ALTER TABLE rep_treatment_timeline_result ADD CONSTRAINT UQ_rep_treatment_timeline_result_report_id_participant_id_event UNIQUE (report_id, participant_id, event_time, event_type_id);
COMMIT;
@@ -0,0 +1,76 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! new tables for NLOS Service in TAB Proxy
-- PROJECT: Ahtc
-- DATE: 2022-02-22
-- VERSION: 2.02
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_medical_information DROP CONSTRAINT IF EXISTS PK_rec_medical_information_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_medical_information DROP CONSTRAINT IF EXISTS IDX_rec_medical_information_sample_time CASCADE;
ALTER TABLE IF EXISTS rec_nlos_fire_result DROP CONSTRAINT IF EXISTS PK_rec_nlos_fire_result_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_nlos_fire_result DROP CONSTRAINT IF EXISTS IDX_rec_nlos_fire_result_sample_time CASCADE;
ALTER TABLE IF EXISTS rec_nlos_simulator_direction DROP CONSTRAINT IF EXISTS PK_rec_nlos_simulator_direction_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_nlos_simulator_direction DROP CONSTRAINT IF EXISTS IDX_rec_nlos_simulator_direction_sample_time CASCADE;
DROP TABLE IF EXISTS rec_medical_information CASCADE;
DROP TABLE IF EXISTS rec_nlos_fire_result CASCADE;
DROP TABLE IF EXISTS rec_nlos_simulator_direction CASCADE;
CREATE TABLE IF NOT EXISTS rec_medical_information (
equipment_number integer,
sample_time bigint,
vital_signs smallint,
body_temperature double precision,
blood_oxygen_peripheral_saturation double precision,
systolic_blood_pressure double precision,
diastolic_blood_pressure double precision,
heart_rate double precision,
respiratory_rate double precision,
rec_id bigint DEFAULT nextval(( 'rec_medical_information_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_medical_information IS 'recorded data for topic MedicalInformation';
CREATE TABLE IF NOT EXISTS rec_nlos_fire_result (
equipment_number integer,
sample_time bigint,
target_equipment_number integer,
shooting_result integer,
rec_id bigint DEFAULT nextval(( 'rec_nlos_fire_result_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_nlos_fire_result IS 'recorded data for topic NlosFireResult';
CREATE TABLE IF NOT EXISTS rec_nlos_simulator_direction (
equipment_number integer,
sample_time bigint,
direction double precision,
rec_id bigint DEFAULT nextval(( 'rec_nlos_simulator_direction_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_nlos_simulator_direction IS 'recorded data for topic NlosSimulatorDirection';
CREATE SEQUENCE IF NOT EXISTS rec_medical_information_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS rec_nlos_fire_result_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS rec_nlos_simulator_direction_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS rec_medical_information ADD CONSTRAINT PK_rec_medical_information_rec_id PRIMARY KEY (rec_id);
ALTER TABLE IF EXISTS rec_nlos_fire_result ADD CONSTRAINT PK_rec_nlos_fire_result_rec_id PRIMARY KEY (rec_id);
ALTER TABLE IF EXISTS rec_nlos_simulator_direction ADD CONSTRAINT PK_rec_nlos_simulator_direction_rec_id PRIMARY KEY (rec_id);
CREATE INDEX IDX_rec_medical_information_sample_time ON rec_medical_information (sample_time);
CREATE INDEX IDX_rec_nlos_fire_result_sample_time ON rec_nlos_fire_result (sample_time);
CREATE INDEX IDX_rec_nlos_simulator_direction_sample_time ON rec_nlos_simulator_direction (sample_time);
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: New properties columns in gear_type and pdm_gear_type_charge_type
-- PROJECT: Ahtc
-- DATE: 2022-03-24
-- VERSION: 2.03
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
ALTER TABLE IF EXISTS pdm_gear_type ADD COLUMN IF NOT EXISTS properties jsonb;
ALTER TABLE IF EXISTS pdm_gear_type_charge_type ADD COLUMN IF NOT EXISTS properties jsonb;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,33 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! New enum MedicalIncident in PDM
-- PROJECT: Ahtc
-- DATE: 2022-03-21
-- VERSION: 2.04
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
ALTER TABLE IF EXISTS pdm_medical_incident DROP CONSTRAINT IF EXISTS PK_pdm_medical_incident_id CASCADE;
DROP TABLE IF EXISTS pdm_medical_incident CASCADE;
CREATE TABLE IF NOT EXISTS pdm_medical_incident (
id integer DEFAULT nextval(( 'pdm.pdm_medical_incident_id_seq'::text)::regclass),
name text
);
CREATE SEQUENCE IF NOT EXISTS pdm_medical_incident_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS pdm_medical_incident ADD CONSTRAINT PK_pdm_medical_incident_id PRIMARY KEY (id);
INSERT INTO pdm_medical_incident (id, name) VALUES (-1, 'None');
INSERT INTO pdm_medical_incident (id, name) VALUES (0, 'Intubation');
INSERT INTO pdm_medical_incident (id, name) VALUES (1, 'Tourniquet');
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Drop FK on material_id to avoid losing report data
-- PROJECT: Ahtc
-- DATE: 2022-03-23
-- VERSION: 2.05
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rep_sanitation_material_data DROP CONSTRAINT IF EXISTS FK_rep_sanitation_material_data_pdm_sanitation_material CASCADE;
ALTER TABLE IF EXISTS rep_sanitation_material_result DROP CONSTRAINT IF EXISTS FK_rep_sanitation_material_result_pdm_sanitation_material CASCADE;
COMMIT;
@@ -0,0 +1,29 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! new column for marker_description added
-- PROJECT: Ahtc
-- DATE: 2022-03-24
-- VERSION: 2.06
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- mrk_marker_type
INSERT INTO mrk_marker_type (id, name) VALUES (8, 'MedicalIncident');
-- mrk_marker_description
ALTER TABLE IF EXISTS mrk_marker_description DROP CONSTRAINT IF EXISTS FK_mrk_marker_description_medical_incident_id_pdm_medical_incid CASCADE;
ALTER TABLE mrk_marker_description ADD medical_incident_id integer;
ALTER TABLE mrk_marker_description ADD CONSTRAINT FK_mrk_marker_description_medical_incident_id_pdm_medical_incid FOREIGN KEY (medical_incident_id) REFERENCES pdm.pdm_medical_incident (id) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! MedicalData column in rec_dynamic_participant_data
-- PROJECT: Ahtc
-- DATE: 2022-03-25
-- VERSION: 2.07
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- PPM
ALTER TABLE IF EXISTS rec_dynamic_participant_data ADD COLUMN IF NOT EXISTS medical_data jsonb;
COMMIT;
@@ -0,0 +1,82 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! Changes from PvSanDyn feature branch
-- PROJECT: Ahtc
-- DATE: 2022-03-25
-- VERSION: 2.08
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
-- drop PKs
ALTER TABLE IF EXISTS pdm_sanitation_injury DROP CONSTRAINT IF EXISTS PK_pdm_sanitation_injury_id CASCADE;
ALTER TABLE IF EXISTS pdm_sanitation_injury_kind DROP CONSTRAINT IF EXISTS PK_pdm_sanitation_injury_kind_id CASCADE;
ALTER TABLE IF EXISTS pdm_sanitation_injury_place_1 DROP CONSTRAINT IF EXISTS PK_pdm_sanitation_injury_place_1_id CASCADE;
ALTER TABLE IF EXISTS pdm_sanitation_injury_place_2 DROP CONSTRAINT IF EXISTS PK_pdm_sanitation_injury_place_2_id CASCADE;
-- drop tables
DROP TABLE IF EXISTS pdm_sanitation_injury CASCADE;
DROP TABLE IF EXISTS pdm_sanitation_injury_kind CASCADE;
DROP TABLE IF EXISTS pdm_sanitation_injury_place_1 CASCADE;
DROP TABLE IF EXISTS pdm_sanitation_injury_place_2 CASCADE;
-- create tables
CREATE TABLE IF NOT EXISTS pdm_sanitation_injury (
id integer,
name text,
kind integer,
place_1 integer,
place_2 integer,
vbg integer
);
CREATE TABLE IF NOT EXISTS pdm_sanitation_injury_kind (
id integer,
name text,
version text
);
CREATE TABLE IF NOT EXISTS pdm_sanitation_injury_place_1 (
id integer,
name text,
version text
);
CREATE TABLE IF NOT EXISTS pdm_sanitation_injury_place_2 (
id integer,
name text,
version text
);
-- add PKs
ALTER TABLE IF EXISTS pdm_sanitation_injury ADD CONSTRAINT PK_pdm_sanitation_injury_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS pdm_sanitation_injury_kind ADD CONSTRAINT PK_pdm_sanitation_injury_kind_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS pdm_sanitation_injury_place_1 ADD CONSTRAINT PK_pdm_sanitation_injury_place_1_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS pdm_sanitation_injury_place_2 ADD CONSTRAINT PK_pdm_sanitation_injury_place_2_id PRIMARY KEY (id);
-- version in sanitation_material
ALTER TABLE IF EXISTS pdm_sanitation_material ADD COLUMN IF NOT EXISTS version text;
-- sanitation procedures
ALTER TABLE IF EXISTS pdm_sanitation_procedures DROP CONSTRAINT IF EXISTS PK_pdm_sanitation_procedures_id CASCADE;
DROP TABLE IF EXISTS pdm_sanitation_procedures CASCADE;
CREATE TABLE IF NOT EXISTS pdm_sanitation_procedures (
id integer,
name text,
type text,
type_id integer,
minimum_qualification integer,
long_name text,
data_code bigint,
version text
);
ALTER TABLE IF EXISTS pdm_sanitation_procedures ADD CONSTRAINT PK_pdm_sanitation_procedures_id PRIMARY KEY (id);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: NOT NECESSARY! New column can_ss_fir_san in whg.ausstg_typen
-- PROJECT: Ahtc
-- DATE: 2022-04-13
-- VERSION: 2.09
-------------------------------------------------------------------------
-- GLOBAL: WHG;
BEGIN;
ALTER TABLE IF EXISTS ausstg_typen ADD COLUMN IF NOT EXISTS can_ss_fir_san BOOLEAN DEFAULT false;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update column ex_NN.rec_equipment_state.vulnerability_kind_id = pdm_vulnerability_kind.ta_vulnerability_kind
-- PROJECT: Guez
-- DATE: 2021-03-10
-- VERSION: 1.01
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
UPDATE rec_equipment_state
SET vulnerability_kind_id = (SELECT ta_vulnerability_kind FROM pdm.pdm_vulnerability_kind WHERE rec_equipment_state.vulnerability_kind_id = pdm.pdm_vulnerability_kind.id);
COMMIT;
@@ -0,0 +1,27 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: drop PK and column id from pdm_vulnerability_kind and add PK on ta_vulnerability_kind
-- PROJECT: Guez
-- DATE: 2021-03-10
-- VERSION: 1.02
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
-- duplicate 459369 -> 459376
UPDATE pdm_vulnerability_kind SET ta_vulnerability_kind = 459376 WHERE player_type_class_id = 3 AND ta_vulnerability_kind = 459369 AND vulnerability_class_id = 5 AND name LIKE 'Sekund%';
-- drop old primary key on column id
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP CONSTRAINT IF EXISTS PK_pdm_vulnerability_kind_id CASCADE;
-- drop column id
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP COLUMN IF EXISTS id CASCADE;
-- create new primary key on ta_vulnerability_kind
ALTER TABLE IF EXISTS pdm_vulnerability_kind DROP CONSTRAINT IF EXISTS PK_pdm_vulnerability_kind_ta_vulnerability_kind CASCADE;
ALTER TABLE IF EXISTS pdm_vulnerability_kind ADD CONSTRAINT PK_pdm_vulnerability_kind_ta_vulnerability_kind PRIMARY KEY (ta_vulnerability_kind);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+90
View File
@@ -0,0 +1,90 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: AES updates (enum, explosion single central table, recorded table and view)
-- PROJECT: Guez
-- DATE: 2021-03-12
-- VERSION: 1.03
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- enum
ALTER TABLE IF EXISTS aes_fuse_type DROP CONSTRAINT IF EXISTS PK_aes_fuse_type_id CASCADE;
DROP TABLE IF EXISTS aes_fuse_type CASCADE;
CREATE TABLE IF NOT EXISTS aes_fuse_type (
id integer,
name text
);
COMMENT ON TABLE aes_fuse_type IS 'static data (<b>not</b> project specific) generate from enum';
ALTER TABLE IF EXISTS aes_fuse_type ADD CONSTRAINT PK_aes_fuse_type_id PRIMARY KEY (id);
INSERT INTO aes_fuse_type (id, name) VALUES (0, 'FtProximity');
INSERT INTO aes_fuse_type (id, name) VALUES (1, 'FtImpact');
INSERT INTO aes_fuse_type (id, name) VALUES (2, 'FtDelay');
-- table aes_explosion_single_central
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS PK_aes_explosion_single_central_id CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS FK_aes_explosion_single_central_explosion_single_id_aes_explosi CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central DROP CONSTRAINT IF EXISTS FK_aes_explosion_single_central_fuse_type_id_aes_fuse_type_id CASCADE;
DROP TABLE IF EXISTS aes_explosion_single_central CASCADE;
CREATE SEQUENCE IF NOT EXISTS aes_explosion_single_central_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE TABLE IF NOT EXISTS aes_explosion_single_central (
id integer DEFAULT nextval(( 'aes_explosion_single_central_id_seq'::text)::regclass),
explosion_single_id integer,
angle double precision,
fuse_type_id integer
);
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT PK_aes_explosion_single_central_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT FK_aes_explosion_single_central_explosion_single_id_aes_explosi FOREIGN KEY (explosion_single_id) REFERENCES aes_explosion_single (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE IF EXISTS aes_explosion_single_central ADD CONSTRAINT FK_aes_explosion_single_central_fuse_type_id_aes_fuse_type_id FOREIGN KEY (fuse_type_id) REFERENCES aes_fuse_type (id) ON DELETE CASCADE ON UPDATE CASCADE;
-- recorded table rec_explosion_single_central
ALTER TABLE IF EXISTS rec_explosion_single_central DROP CONSTRAINT IF EXISTS PK_rec_explosion_single_central_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_explosion_single_central DROP CONSTRAINT IF EXISTS IDX_rec_explosion_single_central_sample_time CASCADE;
DROP TABLE IF EXISTS rec_explosion_single_central CASCADE;
CREATE SEQUENCE IF NOT EXISTS rec_explosion_single_central_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE TABLE IF NOT EXISTS rec_explosion_single_central (
id integer,
name text,
is_deleted boolean,
is_used boolean,
sample_time bigint,
charge_type_id integer,
effect_duration integer,
effect_start bigint,
effect_state_id integer,
party_id integer,
participant_id integer,
effect_marking_in_ta boolean,
external_id bigint,
impact_position_lon double precision,
impact_position_lat double precision,
fire_request_time bigint,
altitude integer,
purpose text,
angle double precision,
fuse_type integer,
rec_id bigint DEFAULT nextval(( 'rec_explosion_single_central_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_explosion_single_central IS 'recorded data for topic ExplosionSingleCentral';
ALTER TABLE IF EXISTS rec_explosion_single_central ADD CONSTRAINT PK_rec_explosion_single_central_rec_id PRIMARY KEY (rec_id);
CREATE INDEX IDX_rec_explosion_single_central_sample_time ON rec_explosion_single_central (sample_time);
-- view aes_explosion_single_central_view
DROP VIEW IF EXISTS aes_explosion_single_central_view;
CREATE OR REPLACE VIEW aes_explosion_single_central_view AS SELECT aes_entity.id AS id, aes_entity.charge_type_id AS charge_type_id, aes_entity.effect_state_id AS effect_state_id, aes_entity.party_id AS party_id, aes_entity.participant_id AS participant_id, aes_entity.effect_duration AS effect_duration, aes_entity.effect_start AS effect_start, aes_entity.name AS name, aes_entity.effect_marking_in_ta AS effect_marking_in_ta, aes_entity.external_id AS external_id, aes_explosion.entity_id AS entity_id, aes_explosion.impact_position_x AS impact_position_x, aes_explosion.impact_position_y AS impact_position_y, aes_explosion.rotation_angle AS rotation_angle, aes_explosion.fire_purpose AS fire_purpose, aes_explosion.fire_request_time AS fire_request_time, aes_explosion.altitude AS altitude, aes_explosion_single.explosion_id AS explosion_id, aes_explosion_single_central.explosion_single_id AS explosion_single_id, aes_explosion_single_central.angle AS angle, aes_explosion_single_central.fuse_type_id AS fuse_type_id, aes_explosion_single_central.id AS aes_explosion_single_central_id
FROM aes_explosion_single_central, aes_entity, aes_explosion, aes_explosion_single
WHERE aes_entity.id = aes_explosion.entity_id AND
aes_explosion.id = aes_explosion_single.explosion_id AND
aes_explosion_single.id = aes_explosion_single_central.explosion_single_id;
COMMIT;
@@ -0,0 +1,42 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Added missing operator rights descriptions
-- PROJECT: Guez
-- DATE: 2021-02-22
-- VERSION: 1.04
-------------------------------------------------------------------------
-- GLOBAL: OPM;
BEGIN;
-- old right without description
UPDATE opm.opm_group SET description = 'Edit Charge Visibility' WHERE name = 'ChargeVisibilityEdit';
UPDATE opm.opm_group SET description = 'SanNineLiner operator rights' WHERE name = 'SanNineLiner';
UPDATE opm.opm_group SET description = 'Edit SanNineLiner' WHERE name = 'SanNineLinerEdit';
UPDATE opm.opm_group SET description = 'Show SanNineLiner' WHERE name = 'SanNineLinerShow';
UPDATE opm.opm_group SET description = 'View Operational Plannings' WHERE name = 'OperationalPlanningView';
UPDATE opm.opm_group SET description = 'Administrator rights' WHERE name = 'Administrator';
UPDATE opm.opm_group SET description = 'Shut down workstations' WHERE name = 'ShutdownWorkstations';
UPDATE opm.opm_group SET description = 'Database Administration' WHERE name = 'DatabaseAdministration';
UPDATE opm.opm_group SET description = 'Change exercise state' WHERE name = 'ExerciseStateEdit';
UPDATE opm.opm_group SET description = 'Edit Codification Data' WHERE name = 'CodificationDataEdit';
UPDATE opm.opm_group SET description = 'Show Codification Data BLUFOR' WHERE name = 'CodificationDataShowBLUFOR';
UPDATE opm.opm_group SET description = 'Show Codification Data OPFOR' WHERE name = 'CodificationDataShowOPFOR';
UPDATE opm.opm_group SET description = 'Allow access to the voice communication channels' WHERE name = 'AvVoiceCommunicationAccess';
UPDATE opm.opm_group SET description = 'Edit Combat Net Radio Frequency Planning' WHERE name = 'FrequencyPlanningEdit';
UPDATE opm.opm_group SET description = 'Show Guez Nasat Configuration' WHERE name = 'GuezNasatConfigurationShow';
UPDATE opm.opm_group SET description = 'Edit Guez Nasat Configuration' WHERE name = 'GuezNasatConfigurationEdit';
-- new operator right for PvSan Reports
INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (520159235, 'ReportsEditSan', 'Create and Edit PvSan Reports');
INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (520093698, 'ReportsEditSan', 'Create and Edit PvSan Reports', 1, true);
INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (520093698, 520159235); -- group_id is: 520093698 = 0x1f000002
INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (520159232, 520093698); -- Reports
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,56 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM views, grant select on views to all users, export csv commented
-- PROJECT: Guez
-- DATE: 2021-03-22
-- VERSION: 1.05
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
DROP VIEW IF EXISTS ism.ism_mpa_barcodes;
CREATE OR REPLACE VIEW ism.ism_mpa_barcodes AS
SELECT asset_id, a.barcode AS asset_barcode, structure_element_id, se.barcode AS se_barcode, se.main_structure_element_id, mse.name
FROM ism.ism_mounting_point_asset mpa, ism.ism_asset a, ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE mpa.asset_id = a.id AND mpa.structure_element_id = se.id AND se.main_structure_element_id = mse.id AND mse.id > 300
AND length(a.barcode) > 0 AND length(se.barcode) > 0
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_mpa_barcodes) TO '/opt/postgres/backup/ism_mpa_barcodes.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_se_barcodes;
CREATE OR REPLACE VIEW ism.ism_se_barcodes AS
SELECT se.id,se.name,se.main_structure_element_id,mse.name as main_name,se.barcode
FROM ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE se.main_structure_element_id = mse.id AND length(se.barcode) > 0 AND mse.id > 300
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_se_barcodes WHERE main_structure_element_id > 300) TO '/opt/postgres/backup/ism_se_barcodes.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_view_plans;
CREATE OR REPLACE VIEW ism.ism_view_plans AS
SELECT mpp.id, mpp.mounting_point_schedule_id, mpp.structure_element_id, se.main_structure_element_id, se.name, mse.name as main_name
FROM ism.ism_mounting_point_plan mpp, ism.ism_structure_element se, ism.ism_main_structure_element mse
WHERE se.id = mpp.structure_element_id AND se.main_structure_element_id = mse.id AND mse.id > 300
ORDER BY mse.id, se.id;
-- COPY (SELECT * from ism.ism_view_plans) TO '/opt/postgres/backup/ism_view_plans.csv' DELIMITER ',' CSV HEADER;
DROP VIEW IF EXISTS ism.ism_view_buildings;
CREATE OR REPLACE VIEW ism.ism_view_buildings AS
SELECT se.id AS se_id, se.main_structure_element_id AS bldg_id, mse.model_id, se.display_name, se.barcode AS se_barcode, se.rel_position_x, se.rel_position_y, se.rel_position_z, mpt.name AS mp_type, mpa.asset_id, at.barcode AS asset_barcode
FROM ism.ism_mounting_point_type mpt, ism.ism_main_structure_element mse, ism.ism_structure_element se LEFT OUTER JOIN ism.ism_mounting_point_asset mpa ON se.id = mpa.structure_element_id
LEFT OUTER JOIN ism.ism_asset at ON mpa.asset_id = at.id
WHERE se.mounting_point_type_id = mpt.id AND se.main_structure_element_id = mse.id
ORDER BY se.main_structure_element_id, se.id;
-- COPY (SELECT * from ism.ism_view_buildings) TO '/opt/postgres/backup/ism_view_buildings.csv' DELIMITER ',' CSV HEADER;
-- grant select on views to all users
GRANT SELECT ON ALL TABLES IN SCHEMA ism TO ets_ro;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,27 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: add column sanitation_unique_id, drop column procedures_needed, change type for procedures_taken as bigint
-- PROJECT: Guez
-- DATE: 2021-03-22
-- VERSION: 1.06
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_dynamic_participant_data ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rep_sanitation_material_data ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rep_sanitation_material_result ADD COLUMN IF NOT EXISTS sanitation_unique_id bigint;
ALTER TABLE IF EXISTS rec_participant_sanitation ADD COLUMN IF NOT EXISTS sanitation_result integer;
ALTER TABLE IF EXISTS rec_participant_sanitation DROP COLUMN IF EXISTS procedures_needed;
ALTER TABLE IF EXISTS rec_participant_sanitation ADD COLUMN IF NOT EXISTS procedures_taken bigint;
ALTER TABLE IF EXISTS rec_participant_sanitation ALTER COLUMN procedures_taken TYPE bigint;
COMMIT;
@@ -0,0 +1,302 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update values in PDM building charge effect
-- PROJECT: Guez
-- DATE: 2021-03-23
-- VERSION: 1.07
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
DELETE FROM pdm.pdm_building_charge_effect;
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (1, 1, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (2, 2, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (3, 3, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (4, 4, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (5, 5, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (6, 6, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (7, 7, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (8, 8, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (9, 9, 10, 10, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (10, 10, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (11, 11, 0, 0, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (12, 12, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (13, 13, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (14, 14, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (15, 15, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (16, 16, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (17, 17, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (18, 18, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (19, 19, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (20, 20, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (21, 21, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (22, 22, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (23, 23, 0, 0, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (24, 24, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (25, 25, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (26, 26, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (27, 27, 10, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (28, 28, 10, 1, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (29, 29, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (30, 30, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (31, 31, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (32, 32, 10, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (33, 33, 1, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (34, 34, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (35, 35, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (36, 36, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (37, 37, 5, 5, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (38, 38, 10, 5, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (39, 39, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (40, 40, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (41, 41, 5, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (42, 42, 10, 0, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (43, 43, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (44, 44, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (45, 45, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (46, 48, 10, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (47, 49, 50, 10, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (48, 50, 10, 5000, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (49, 51, 0, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (50, 52, 5000, 5000, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (51, 53, 10, 5, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (52, 54, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (53, 55, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (54, 56, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (55, 57, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (56, 58, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (57, 59, 1, 1, 6, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (58, 60, 10, 150, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (59, 61, 10, 150, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (60, 62, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (61, 63, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (62, 64, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (63, 65, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (64, 66, 5, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (65, 67, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (66, 68, 10, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (67, 69, 50, 10, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (68, 70, 100, 100, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (69, 71, 300, 300, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (70, 72, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (71, 73, 10, 10, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (72, 74, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (73, 75, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (74, 76, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (75, 77, 5, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (76, 78, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (77, 79, 300, 300, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (78, 371, 100, 150, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (79, 372, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (80, 373, 50, 50, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (81, 374, 0, 0, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (82, 375, 0, 0, 4, true, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (83, 381, 100, 150, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (84, 382, 10, 5, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (85, 385, 0, 0, 4, true, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (86, 471, 10, 5, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (87, 472, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (88, 474, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (89, 476, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (90, 482, 100, 200, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (91, 2001, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (92, 2002, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (93, 2003, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (94, 2004, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (95, 2005, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (96, 2006, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (97, 2007, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (98, 2008, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (99, 2009, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (100, 2010, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (101, 2011, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (102, 2012, 5, 5, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (103, 2013, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (104, 2014, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (105, 2015, 10, 10, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (106, 2016, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (107, 2017, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (108, 2018, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (109, 2019, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (110, 2020, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (111, 2021, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (112, 2022, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (113, 2023, 5, 1, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (114, 2024, 0, 0, 19, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (115, 2025, 5, 0, 19, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (116, 2026, 10, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (117, 2027, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (118, 2028, 10, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (119, 2029, 10, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (120, 2030, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (121, 2031, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (122, 2032, 25, 25, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (123, 2033, 25, 25, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (124, 2034, 5, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (125, 2035, 15, 15, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (126, 2036, 15, 15, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (127, 2037, 10, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (128, 2038, 10, 5, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (129, 2039, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (130, 2040, 10, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (131, 2041, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (132, 2042, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (133, 2043, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (134, 2044, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (135, 2045, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (136, 2046, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (137, 2047, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (138, 2048, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (139, 2049, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (140, 2050, 10, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (141, 2051, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (142, 2052, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (143, 2053, 25, 25, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (144, 2054, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (145, 2055, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (146, 2056, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (147, 2057, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (148, 2058, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (149, 2059, 150, 300, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (150, 2060, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (151, 2061, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (152, 2062, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (153, 2063, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (154, 2064, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (155, 2065, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (156, 2066, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (157, 2067, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (158, 2068, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (159, 2069, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (160, 2070, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (161, 2071, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (162, 2072, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (163, 2073, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (164, 2074, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (165, 2075, 10, 50, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (166, 2076, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (167, 2077, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (168, 2078, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (169, 2079, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (170, 2080, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (171, 2081, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (172, 2082, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (173, 2083, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (174, 2084, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (175, 2085, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (176, 2086, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (177, 2087, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (178, 2088, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (179, 2089, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (180, 2090, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (181, 2091, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (182, 2092, 150, 100, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (183, 2093, 150, 300, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (184, 2094, 150, 300, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (185, 2095, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (186, 2096, 10, 10, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (187, 2097, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (188, 2098, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (189, 2099, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (190, 2100, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (191, 2101, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (192, 2102, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (193, 2103, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (194, 2104, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (195, 2105, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (196, 2106, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (197, 2107, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (198, 2108, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (199, 2109, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (200, 2110, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (201, 2111, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (202, 2112, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (203, 2113, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (204, 2114, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (205, 2115, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (206, 2116, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (207, 2117, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (208, 2118, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (209, 2119, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (210, 2120, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (211, 2121, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (212, 2122, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (213, 2123, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (214, 2124, 100, 200, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (215, 2125, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (216, 2126, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (217, 2127, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (218, 2128, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (219, 2129, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (220, 2130, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (221, 2131, 150, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (222, 2132, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (223, 2133, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (224, 2134, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (225, 2135, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (226, 2136, 300, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (227, 2137, 300, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (228, 2138, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (229, 2139, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (230, 2140, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (231, 2141, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (232, 2142, 10, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (233, 2143, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (234, 2144, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (235, 2145, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (236, 2146, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (237, 2147, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (238, 2148, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (239, 2149, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (240, 2150, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (241, 2151, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (242, 2152, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (243, 2153, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (244, 2154, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (245, 2155, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (246, 2156, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (247, 2157, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (248, 2158, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (249, 2159, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (250, 2160, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (251, 2161, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (252, 2162, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (253, 2163, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (254, 2164, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (255, 2165, 150, 1000, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (256, 2166, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (257, 2167, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (258, 2168, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (259, 2169, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (260, 2170, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (261, 2171, 150, 10, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (262, 2172, 300, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (263, 2173, 5000, 5000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (264, 2174, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (265, 2175, 5, 0, 17, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (266, 2176, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (267, 2177, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (268, 2178, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (269, 2179, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (270, 2180, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (271, 2181, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (272, 2182, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (273, 2183, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (274, 2184, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (275, 2185, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (276, 2186, 5000, 5000, 10, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (277, 2187, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (278, 2188, 10, 10, 17, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (279, 2189, 10, 0, 9, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (280, 2190, 10, 0, 9, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (281, 2191, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (282, 2192, 5, 0, 13, true, true);
ALTER SEQUENCE pdm.pdm_building_charge_effect_id_seq RESTART WITH 283;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,114 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: New Sanitation Procedures in PDM, changes in EX rec_sanitation, new sanitation materials
-- PROJECT: Guez
-- DATE: 2021-05-18
-- VERSION: 1.08
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
DELETE FROM pdm_sanitation_procedures;
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (0, 'None');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (1, 'ApplTourniquet');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (2, 'PressureDress');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (3, 'Hemostyptics');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (4, 'ManCompression');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (5, 'Tamponade');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (6, 'JawThrustMan');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (7, 'WendlTube');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (8, 'RecPosition');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (9, 'HeadOfBedEle');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (10, 'GuedelTube');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (11, 'LarynxTube');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (12, 'EmergencyCric');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (13, 'TrachealTube');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (14, 'ChestSeal');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (15, 'OxygenDelivery');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (16, 'ChestTube');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (17, 'AsVentilation');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (18, 'ShockPosition');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (19, 'IVAccess');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (20, 'IOAccess');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (21, 'FluidSubstitut');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (22, 'AssessmAwaren');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (23, 'DeterminCGS');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (24, 'RecovPosition');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (25, 'Positioning');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (26, 'VitSignsCheck');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (27, 'UniversalRail');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (28, 'BleedingControl');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (29, 'RescueBlanket');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (30, 'Blizzard');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (31, 'TreatmBurnings');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (32, 'GenWoundCare');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (33, 'Analgesics');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (34, 'Antibiotics');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (35, 'TranesamicAcid');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (36, 'Hypnotics');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (37, 'RingersSolution');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (38, 'MuscleRelaxant');
INSERT INTO pdm_sanitation_procedures (id, name) VALUES (99, 'Unknown');
-- PDM: New sanitation materials (IO, 2021.05.18)
-- do not delete old ida 1-8 because of FK
--DELETE FROM pdm.pdm_sanitation_material;
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (1, 'Tourniquet');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (2, 'Notverband');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (3, 'QuikClot-Combatgauze');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (4, 'AMD Verband');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (5, 'Wendl-Tubus');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (6, 'Guedel-Tubus');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (7, 'Larynx-Tubus');
--INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (8, 'Not-Koniotomie-Set');
-- old ids, new names
UPDATE pdm.pdm_sanitation_material SET name = 'Tourniquet' WHERE id = 1;
UPDATE pdm.pdm_sanitation_material SET name = 'Notverband' WHERE id = 2;
UPDATE pdm.pdm_sanitation_material SET name = 'QuikClot-Combatgauze' WHERE id = 3;
UPDATE pdm.pdm_sanitation_material SET name = 'AMD Verband' WHERE id = 4;
UPDATE pdm.pdm_sanitation_material SET name = 'Wendl-Tubus' WHERE id = 5;
UPDATE pdm.pdm_sanitation_material SET name = 'Guedel-Tubus' WHERE id = 6;
UPDATE pdm.pdm_sanitation_material SET name = 'Larynx-Tubus' WHERE id = 7;
UPDATE pdm.pdm_sanitation_material SET name = 'Not-Koniotomie-Set' WHERE id = 8;
-- New material ids
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (9, 'Endotracheal-Tubus');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (10, 'Thoraxpflaster');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (11, 'Dekompressionsnadel');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (12, 'Beutelmaske');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (13, 'i. v. Zugang-Set');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (14, 'i. o. Zugang-Set');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (15, 'Voll-Elektrolytlösung');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (16, 'Dreiecktuch');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (17, 'Universalschiene');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (18, 'Rettungsdecke');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (19, 'Blizzard');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (20, 'Brandwundenverbandpäckchen');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (21, 'Allg. Wundversorgung');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (22, 'Morphin-Autoinjektor');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (23, 'Antibiotikum');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (24, 'Tranexamsäure');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (25, 'Hypnotikum');
INSERT INTO pdm.pdm_sanitation_material (id, name) VALUES (26, 'Muskelrelaxans');
--UPDATE pdm.pdm_sanitation_material SET description = name;
ALTER SEQUENCE pdm.pdm_sanitation_material_id_seq RESTART WITH 27;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_sanitation DROP COLUMN IF EXISTS data_sanitation_procedures_needed;
ALTER TABLE IF EXISTS rec_sanitation ALTER COLUMN data_sanitation_procedures_taken TYPE bigint;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS sanitation_procedures_taken bigint;
ALTER TABLE IF EXISTS rep_treatment_data ADD COLUMN IF NOT EXISTS sanitation_result integer;
ALTER TABLE IF EXISTS rep_treatment_data DROP COLUMN IF EXISTS success_treatment;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS sanitation_procedures_taken bigint;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS sanitation_result integer;
ALTER TABLE IF EXISTS rep_treatment_result DROP COLUMN IF EXISTS success_treatment;
ALTER TABLE IF EXISTS rep_treatment_result ADD COLUMN IF NOT EXISTS priority_correct boolean;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: new columns originator_building_id and originator_room_id in recorded table rec_hit_line_info (SVN 53507)
-- PROJECT: Guez
-- DATE: 2021-05-27
-- VERSION: 1.09
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_hit_line_info ADD COLUMN IF NOT EXISTS originator_building_id INTEGER;
ALTER TABLE IF EXISTS rec_hit_line_info ADD COLUMN IF NOT EXISTS originator_room_id INTEGER;
COMMIT;
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Fixes NLDEVCTRL-925 (RPL Nr 728: MunCode falsch)
-- PROJECT: Guez
-- DATE: 2021-06-21
-- VERSION: 1.10
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
UPDATE pdm.pdm_charge_type SET name='22mm / 23mm AP', short_name='22mm / 23mm AP' WHERE id=2035;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+23
View File
@@ -0,0 +1,23 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add role ctc_sv (backwords compatibility, used for MBA)
-- PROJECT: Guez
-- DATE: 2021-06-22
-- VERSION: 1.11
-------------------------------------------------------------------------
-- GLOBAL: PUBLIC;
BEGIN;
-- For Convenience (Backwards Usability)
--CREATE USER ctc PASSWORD 'ctc11de' CREATEROLE;
CREATE USER ctc_sv PASSWORD 'ctc11de' CREATEROLE;
--CREATE USER ctc_ws PASSWORD 'ctc11de' CREATEROLE;
GRANT ets_ro TO ctc, ctc_sv;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+19
View File
@@ -0,0 +1,19 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Added column Name to ISM MPA (SVN 53407)
-- PROJECT: Guez
-- DATE: 2021-06-22
-- VERSION: 1.12
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
ALTER TABLE ism_mounting_point_asset ADD COLUMN name text;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,40 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add table egcu_relay_info in ASM (SVN 53346)
-- PROJECT: Guez
-- DATE: 2021-06-22
-- VERSION: 1.13
-------------------------------------------------------------------------
-- GLOBAL: ASM;
BEGIN;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS PK_asm_egcu_relay_info_id CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_id CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_name CASCADE;
ALTER TABLE IF EXISTS asm_egcu_relay_info DROP CONSTRAINT IF EXISTS UQ_asm_egcu_relay_info_relay_id CASCADE;
DROP TABLE IF EXISTS asm_egcu_relay_info CASCADE;
CREATE TABLE IF NOT EXISTS asm_egcu_relay_info (
id integer DEFAULT nextval(( 'asm.asm_egcu_relay_info_id_seq'::text)::regclass),
relay_id integer, -- Index of Relay
name text, -- Name of relay
description text, -- description of relay
properties text -- properties of relay
);
COMMENT ON TABLE asm_egcu_relay_info IS 'EGCU-Relay-Names';
COMMENT ON COLUMN asm_egcu_relay_info.relay_id IS 'Index of Relay';
COMMENT ON COLUMN asm_egcu_relay_info.name IS 'Name of relay';
COMMENT ON COLUMN asm_egcu_relay_info.description IS 'description of relay';
COMMENT ON COLUMN asm_egcu_relay_info.properties IS 'properties of relay';
CREATE SEQUENCE IF NOT EXISTS asm_egcu_relay_info_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS asm_egcu_relay_info ADD CONSTRAINT PK_asm_egcu_relay_info_id PRIMARY KEY (id);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_id UNIQUE (id);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_name UNIQUE (name);
ALTER TABLE asm_egcu_relay_info ADD CONSTRAINT UQ_asm_egcu_relay_info_relay_id UNIQUE (relay_id);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,53 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add table bcu_egcu_relay_infos in Exercise BLD (SVN 53304, 53573)
-- PROJECT: Guez
-- DATE: 2021-06-23
-- VERSION: 1.14
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
-- Drop tables/views/sequences/constraints
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS PK_bcu_egcu_relay_infos_id CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_id CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_index CASCADE;
ALTER TABLE IF EXISTS bcu_egcu_relay_infos DROP CONSTRAINT IF EXISTS UQ_bcu_egcu_relay_infos_name CASCADE;
DROP TABLE IF EXISTS bcu_egcu_relay_infos CASCADE;
-- Create tables
CREATE TABLE IF NOT EXISTS bcu_egcu_relay_infos (
id integer DEFAULT nextval(( 'bcu_egcu_relay_infos_id_seq'::text)::regclass),
asset_id bigint, -- 0 = default for all EGCUs &gt, 0 = assetId for special entries
index integer DEFAULT nextval(( 'bcu_egcu_relay_infos_index_seq'::text)::regclass), -- Index of Relay
name text, -- Name of relay
description text, -- description of relay
properties text -- properties of relay
);
COMMENT ON TABLE bcu_egcu_relay_infos IS 'EGCU-Relay-Names';
COMMENT ON COLUMN bcu_egcu_relay_infos.asset_id IS '0 = default for all EGCUs &gt, 0 = assetId for special entries';
COMMENT ON COLUMN bcu_egcu_relay_infos.index IS 'Index of Relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.name IS 'Name of relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.description IS 'description of relay';
COMMENT ON COLUMN bcu_egcu_relay_infos.properties IS 'properties of relay';
-- Create sequence(s)
CREATE SEQUENCE IF NOT EXISTS bcu_egcu_relay_infos_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS bcu_egcu_relay_infos_index_seq INCREMENT 1 START 0 MINVALUE 0;
-- Create primary keys
ALTER TABLE IF EXISTS bcu_egcu_relay_infos ADD CONSTRAINT PK_bcu_egcu_relay_infos_id PRIMARY KEY (id);
-- Indexes
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_id UNIQUE (id);
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_index UNIQUE (index);
ALTER TABLE bcu_egcu_relay_infos ADD CONSTRAINT UQ_bcu_egcu_relay_infos_name UNIQUE (name);
COMMIT;
@@ -0,0 +1,23 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add values in table asm.egcu_relay_info (SVN 53405)
-- PROJECT: Guez
-- DATE: 2021-06-23
-- VERSION: 1.15
-------------------------------------------------------------------------
-- GLOBAL: ASM;
BEGIN;
-- EGCU Relay Infos Note: Description and Properties available but unused, Don't insert unused relays!
INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name) VALUES (1, 0, 'Lampe');
INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name) VALUES (2, 1, 'Heizung');
INSERT INTO asm.asm_egcu_relay_info(id, relay_id, name, properties) VALUES (3, 2, 'Nebel', '{"allowPermanentOn":false}');
ALTER SEQUENCE asm.asm_egcu_relay_info_id_seq RESTART WITH 4;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+639
View File
@@ -0,0 +1,639 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update values in PDM (SVN 53828) - gear_type_charge_type, building_charge_effect, charge_type Nebel
-- PROJECT: Guez
-- DATE: 2021-03-25
-- VERSION: 1.16
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
-- pdm_gear_type
DELETE FROM pdm_gear_type WHERE id = 1301;
-- pdm_charge_type
--UPDATE pdm_charge_type SET name = 'Nebel', short_name = 'Nebel' WHERE id = 375;
--DELETE FROM pdm_charge_type WHERE id = 385;
-- pdm_translation
DELETE FROM pdm_translation WHERE translation = 'Aerial Ordnance';
--DELETE FROM pdm_translation WHERE key = 'Nebel Art';
--DELETE FROM pdm_translation WHERE key = 'Nebel Mrs';
--INSERT INTO pdm_translation (iso_code, disambiguation, context, key, translation) VALUES ('en_GB', 'name', 'ChargeType', 'Nebel', 'Smoke');
--INSERT INTO pdm_translation (iso_code, disambiguation, context, key, translation) VALUES ('en_GB', 'shortName', 'ChargeType', 'Nebel', 'Smoke');
-- pdm_gear_type_charge_type;
DELETE FROM pdm_gear_type_charge_type;
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (101, 311, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (101, 312, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (101, 313, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (101, 314, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (101, 315, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (201, 321, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (401, 341, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (401, 342, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (401, 343, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 211, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 211, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 212, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 212, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 213, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 213, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 214, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 214, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 215, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 215, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (501, 216, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (601, 216, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (701, 371, 29650);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (701, 372, 29650);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (701, 373, 25190);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (701, 374, 26160);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (701, 375, 25190);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (801, 381, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (801, 382, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1101, 411, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1101, 412, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1101, 413, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1201, 421, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 1, 2500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2, 3500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 3, 4500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 4, 3500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 5, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 6, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 7, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 8, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 9, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 10, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 11, 800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 12, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 13, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 14, 3500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 15, 1975);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 16, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 17, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 18, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 19, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 20, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 21, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 22, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 23, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 24, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 25, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 26, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 27, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 28, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 29, 1850);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 30, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 31, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 32, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 33, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 34, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 35, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 36, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 37, 1850);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 38, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 39, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 40, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 41, 1250);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 42, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 43, 1850);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 44, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 45, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 48, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 49, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1033, 50, 50);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1025, 51, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 52, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 53, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1019, 54, 1850);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 55, 4);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1017, 56, 500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 57, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1026, 58, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 59, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1035, 60, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 61, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 62, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 63, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1019, 64, 1850);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 65, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1033, 66, 50);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1021, 67, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 68, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 69, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 70, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1019, 71, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1022, 72, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1021, 73, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1021, 74, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1018, 75, 150);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1020, 76, 50);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 77, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 78, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 79, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 471, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 472, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 473, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 474, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 475, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 476, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 477, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 478, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 479, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 480, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 481, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 482, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 483, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1701, 484, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2001, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2002, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2003, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2004, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2005, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2006, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2007, 800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2008, 800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2009, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2010, 1200);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2011, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2012, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2013, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2014, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2015, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2016, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2017, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2018, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2019, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2020, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2021, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2022, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2023, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2024, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2025, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2026, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2027, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2028, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2029, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2030, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2031, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2032, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2033, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2034, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2035, 1000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2036, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2037, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2038, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2039, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2040, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2041, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2042, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2043, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2044, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2045, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2046, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2047, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2048, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2049, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2050, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2051, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2052, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2053, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2054, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2055, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2056, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2057, 450);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2058, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2059, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2060, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2061, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2062, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2063, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2064, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2065, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2066, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2067, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2068, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2069, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2070, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2071, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2072, 400);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2073, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2074, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2075, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2076, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2077, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2078, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2079, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2080, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2081, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2082, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2083, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2084, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2085, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2086, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2087, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2088, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2089, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2090, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2091, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2092, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2093, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2094, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2095, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2096, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2097, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2098, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2099, 2000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2100, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2101, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2102, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2103, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2104, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2105, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2106, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2107, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2108, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2109, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2110, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2111, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2112, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2113, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2114, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2115, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2116, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2117, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2118, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2119, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2120, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2121, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2122, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2123, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2124, 27000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2125, 8000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2126, 8000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2127, 8000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2128, 8000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2129, 3750);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2130, 3750);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2131, 600);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2132, 3750);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2133, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2134, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2135, 1500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2136, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2137, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2138, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2139, 4300);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2140, 4300);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2141, 1975);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2142, 3000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2143, 2500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2144, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2145, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2146, 800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2147, 800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2148, 600);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2149, 12000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2150, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2151, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2152, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2153, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2154, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2155, 7000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2156, 7000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2157, 7000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2158, 7000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2159, 1800);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2160, 2500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2161, 2500);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2162, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2163, 4000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2164, 8000);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2165, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2166, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2167, 350);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2168, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2169, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2170, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2171, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2172, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2173, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2174, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2175, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2176, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2177, 50);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2178, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2179, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2180, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2181, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2182, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2183, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2184, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2185, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2186, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2187, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2188, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2189, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2190, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2191, NULL);
INSERT INTO pdm.pdm_gear_type_charge_type (gear_type_id, charge_type_id, max_range) VALUES (1000, 2192, NULL);
-- from update 1.28
--UPDATE pdm.pdm_gear_type_charge_type SET max_range=1000 WHERE gear_type_id = 1000 AND charge_type_id = 2035;
--UPDATE pdm.pdm_gear_type_charge_type SET max_range=2000 WHERE gear_type_id = 1000 AND charge_type_id = 2036;
-- pdm_building_charge_effect
-- deleting 375, 385 was enough, but let's make sure we have the latest values
-- DELETE FROM pdm.pdm_building_charge_effect WHERE charge_type_id IN (375, 385);
DELETE FROM pdm.pdm_building_charge_effect;
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (1, 1, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (2, 2, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (3, 3, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (4, 4, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (5, 5, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (6, 6, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (7, 7, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (8, 8, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (9, 9, 10, 10, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (10, 10, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (11, 11, 0, 0, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (12, 12, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (13, 13, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (14, 14, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (15, 15, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (16, 16, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (17, 17, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (18, 18, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (19, 19, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (20, 20, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (21, 21, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (22, 22, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (23, 23, 0, 0, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (24, 24, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (25, 25, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (26, 26, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (27, 27, 10, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (28, 28, 10, 1, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (29, 29, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (30, 30, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (31, 31, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (32, 32, 10, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (33, 33, 1, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (34, 34, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (35, 35, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (36, 36, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (37, 37, 5, 5, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (38, 38, 10, 5, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (39, 39, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (40, 40, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (41, 41, 5, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (42, 42, 10, 0, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (43, 43, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (44, 44, 5, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (45, 45, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (46, 48, 10, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (47, 49, 50, 10, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (48, 50, 10, 5000, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (49, 51, 0, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (50, 52, 5000, 5000, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (51, 53, 10, 5, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (52, 54, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (53, 55, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (54, 56, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (55, 57, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (56, 58, 1, 1, 6, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (57, 59, 1, 1, 6, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (58, 60, 10, 150, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (59, 61, 10, 150, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (60, 62, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (61, 63, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (62, 64, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (63, 65, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (64, 66, 5, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (65, 67, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (66, 68, 10, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (67, 69, 50, 10, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (68, 70, 100, 100, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (69, 71, 300, 300, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (70, 72, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (71, 73, 10, 10, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (72, 74, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (73, 75, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (74, 76, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (75, 77, 5, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (76, 78, 0, 0, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (77, 79, 300, 300, NULL, false, false);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (78, 371, 100, 150, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (79, 372, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (80, 373, 50, 50, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (81, 374, 0, 0, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (83, 381, 100, 150, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (84, 382, 10, 5, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (86, 471, 10, 5, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (87, 472, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (88, 474, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (89, 476, 50, 100, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (90, 482, 100, 200, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (91, 2001, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (92, 2002, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (93, 2003, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (94, 2004, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (95, 2005, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (96, 2006, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (97, 2007, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (98, 2008, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (99, 2009, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (100, 2010, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (101, 2011, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (102, 2012, 5, 5, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (103, 2013, 1, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (104, 2014, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (105, 2015, 10, 10, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (106, 2016, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (107, 2017, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (108, 2018, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (109, 2019, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (110, 2020, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (111, 2021, 5, 0, 1, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (112, 2022, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (113, 2023, 5, 1, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (114, 2024, 0, 0, 19, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (115, 2025, 5, 0, 19, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (116, 2026, 10, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (117, 2027, 5, 0, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (118, 2028, 10, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (119, 2029, 10, 5, 2, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (120, 2030, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (121, 2031, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (122, 2032, 25, 25, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (123, 2033, 25, 25, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (124, 2034, 5, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (125, 2035, 15, 15, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (126, 2036, 15, 15, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (127, 2037, 10, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (128, 2038, 10, 5, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (129, 2039, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (130, 2040, 10, 0, 12, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (131, 2041, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (132, 2042, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (133, 2043, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (134, 2044, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (135, 2045, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (136, 2046, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (137, 2047, 10, 5, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (138, 2048, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (139, 2049, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (140, 2050, 10, 0, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (141, 2051, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (142, 2052, 10, 10, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (143, 2053, 25, 25, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (144, 2054, 10, 5, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (145, 2055, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (146, 2056, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (147, 2057, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (148, 2058, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (149, 2059, 150, 300, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (150, 2060, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (151, 2061, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (152, 2062, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (153, 2063, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (154, 2064, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (155, 2065, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (156, 2066, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (157, 2067, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (158, 2068, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (159, 2069, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (160, 2070, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (161, 2071, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (162, 2072, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (163, 2073, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (164, 2074, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (165, 2075, 10, 50, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (166, 2076, 10, 10, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (167, 2077, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (168, 2078, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (169, 2079, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (170, 2080, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (171, 2081, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (172, 2082, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (173, 2083, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (174, 2084, 10, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (175, 2085, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (176, 2086, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (177, 2087, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (178, 2088, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (179, 2089, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (180, 2090, 150, 150, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (181, 2091, 150, 1000, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (182, 2092, 150, 100, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (183, 2093, 150, 300, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (184, 2094, 150, 300, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (185, 2095, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (186, 2096, 10, 10, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (187, 2097, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (188, 2098, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (189, 2099, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (190, 2100, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (191, 2101, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (192, 2102, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (193, 2103, 150, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (194, 2104, 150, 1000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (195, 2105, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (196, 2106, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (197, 2107, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (198, 2108, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (199, 2109, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (200, 2110, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (201, 2111, 300, 1000, 4, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (202, 2112, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (203, 2113, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (204, 2114, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (205, 2115, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (206, 2116, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (207, 2117, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (208, 2118, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (209, 2119, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (210, 2120, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (211, 2121, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (212, 2122, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (213, 2123, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (214, 2124, 100, 200, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (215, 2125, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (216, 2126, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (217, 2127, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (218, 2128, 300, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (219, 2129, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (220, 2130, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (221, 2131, 150, 1000, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (222, 2132, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (223, 2133, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (224, 2134, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (225, 2135, 150, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (226, 2136, 300, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (227, 2137, 300, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (228, 2138, 10, 10, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (229, 2139, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (230, 2140, 150, 300, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (231, 2141, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (232, 2142, 10, 150, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (233, 2143, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (234, 2144, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (235, 2145, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (236, 2146, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (237, 2147, 10, 50, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (238, 2148, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (239, 2149, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (240, 2150, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (241, 2151, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (242, 2152, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (243, 2153, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (244, 2154, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (245, 2155, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (246, 2156, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (247, 2157, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (248, 2158, 150, 150, 18, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (249, 2159, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (250, 2160, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (251, 2161, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (252, 2162, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (253, 2163, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (254, 2164, 150, 300, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (255, 2165, 150, 1000, 14, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (256, 2166, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (257, 2167, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (258, 2168, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (259, 2169, 0, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (260, 2170, 10, 0, 3, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (261, 2171, 150, 10, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (262, 2172, 300, 300, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (263, 2173, 5000, 5000, 5, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (264, 2174, 150, 150, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (265, 2175, 5, 0, 17, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (266, 2176, 10, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (267, 2177, 1, 0, 11, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (268, 2178, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (269, 2179, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (270, 2180, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (271, 2181, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (272, 2182, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (273, 2183, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (274, 2184, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (275, 2185, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (276, 2186, 5000, 5000, 10, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (277, 2187, 0, 0, NULL, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (278, 2188, 10, 10, 17, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (279, 2189, 10, 0, 9, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (280, 2190, 10, 0, 9, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (281, 2191, 5, 0, 13, true, true);
INSERT INTO pdm.pdm_building_charge_effect (id, charge_type_id, destructive_factor, penetration_factor, hit_sound, difcue_light, difcue_pyro) VALUES (282, 2192, 5, 0, 13, true, true);
ALTER SEQUENCE pdm.pdm_building_charge_effect_id_seq RESTART WITH 283;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,28 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: New operator rights EgcuMonitorShow and EgcuRoomsEdit
-- PROJECT: Guez
-- DATE: 2021-06-29
-- VERSION: 1.17
-------------------------------------------------------------------------
-- GLOBAL: OPM;
BEGIN;
--- Base: 738263040, EgcuMonitorShow - 738263047 = 0x2c010007
INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (738263047, 'EgcuMonitorShow', 'Show EgcuMonitor');
INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (738197509, 'EgcuMonitorShow', 'Show EgcuMonitor', 1, true);
INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (738197509, 738263047); -- group_id is: 738197509 = 0x2c000005
INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (738263040, 738197509); -- Service Monitors - Participants
--- Base: 738263040, EgcuRoomsEdit - 738263048 = 0x2c010008
INSERT INTO opm.opm_access_control_level (id, name, description) VALUES (738263048, 'EgcuRoomsEdit', 'Edit the rooms belonging to one segment.');
INSERT INTO opm.opm_group (id, name, description, type_id, is_hidden) VALUES (738197510, 'EgcuRoomsEdit', 'Edit the rooms belonging to one segment.', 1, true);
INSERT INTO opm.opm_acl_allow (group_id, acl_id) VALUES (738197510, 738263048); -- group_id is: 738197510 = 0x2c000006
INSERT INTO opm.opm_group_group (group_id, is_member_of_group_id) VALUES (738263040, 738197510); -- Service Monitors - Participants
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,461 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update dis_entity in PDM and generate codes 2xxx, 4xxx etc.
-- PROJECT: Guez
-- DATE: 2021-07-26
-- VERSION: 1.18
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
-- Direct Fire with alterations such as "Burst of Fire", "Unarmed", etc.
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4001, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.5', properties FROM pdm.pdm_charge_type WHERE id = 2001;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4002, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.6', properties FROM pdm.pdm_charge_type WHERE id = 2002;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4003, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.7', properties FROM pdm.pdm_charge_type WHERE id = 2003;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4004, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.8', properties FROM pdm.pdm_charge_type WHERE id = 2004;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4007, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.9', properties FROM pdm.pdm_charge_type WHERE id = 2007;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4008, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.10', properties FROM pdm.pdm_charge_type WHERE id = 2008;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4009, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.11', properties FROM pdm.pdm_charge_type WHERE id = 2009;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4010, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.8.225.2.16.0.12', properties FROM pdm.pdm_charge_type WHERE id = 2010;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4015, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.2.11.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2015;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4016, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.2.11.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2016;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4017, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.2.11.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2017;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4018, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.2.11.0.3', properties FROM pdm.pdm_charge_type WHERE id = 2018;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4019, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.9.0.4', properties FROM pdm.pdm_charge_type WHERE id = 2019;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4020, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.9.0.5', properties FROM pdm.pdm_charge_type WHERE id = 2020;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4021, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.10.0.10', properties FROM pdm.pdm_charge_type WHERE id = 2021;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4034, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.10.0.11', properties FROM pdm.pdm_charge_type WHERE id = 2034;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4035, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.10.0.12', properties FROM pdm.pdm_charge_type WHERE id = 2035;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4036, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.14.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2036;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4037, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.225.2.14.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2037;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4038, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.1.6.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2038;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4040, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.9.222.1.11.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2040;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4041, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.1.10.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2041;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4042, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.1.11.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2042;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4044, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.1.13.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2044;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 4045, name || ' (BoF)', short_name || ' (BoF)', predefined_name, '2.2.222.1.14.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2045;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6022, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.14.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2022;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6024, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.14.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2024;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6025, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.16.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2025;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6026, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.16.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2026;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6027, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.26.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2027;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6030, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.222.1.45.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2030;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6031, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.4.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2031;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6036, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.3.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2036;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6039, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.3.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2039;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6040, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.16.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2040;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6043, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.16.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2043;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6044, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.1.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2044;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6045, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.1.4.0', properties FROM pdm.pdm_charge_type WHERE id = 2045;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6047, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.1.4.1', properties FROM pdm.pdm_charge_type WHERE id = 2047;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6048, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.1.5.0', properties FROM pdm.pdm_charge_type WHERE id = 2048;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6051, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.1.5.1', properties FROM pdm.pdm_charge_type WHERE id = 2051;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6053, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2053;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6055, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.2.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2055;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6057, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.8.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2057;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6060, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.225.1.8.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2060;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6065, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.4.225.1.6.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2065;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6069, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.71.1.3.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2069;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6077, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.71.1.3.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2077;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6081, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.71.1.4.2.0', properties FROM pdm.pdm_charge_type WHERE id = 2081;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6085, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.71.1.4.3.0', properties FROM pdm.pdm_charge_type WHERE id = 2085;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6086, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.224.1.5.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2086;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6091, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.224.1.5.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2091;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6096, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.224.1.5.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2096;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6097, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.2.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2097;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6103, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.2.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2103;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6105, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.71.1.2.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2105;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6107, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.224.1.9.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2107;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6110, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.1.0', properties FROM pdm.pdm_charge_type WHERE id = 2110;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6121, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.1.3', properties FROM pdm.pdm_charge_type WHERE id = 2121;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6170, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.2.0', properties FROM pdm.pdm_charge_type WHERE id = 2170;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6171, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.2.4', properties FROM pdm.pdm_charge_type WHERE id = 2171;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6172, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.2.5', properties FROM pdm.pdm_charge_type WHERE id = 2172;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6173, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2173;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6175, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2175;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6176, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.3.0', properties FROM pdm.pdm_charge_type WHERE id = 2176;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 6191, name || ' (AB)', short_name || ' (AB)', predefined_name, '2.2.205.1.1.3.1', properties FROM pdm.pdm_charge_type WHERE id = 2191;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8056, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.9', properties FROM pdm.pdm_charge_type WHERE id = 2056;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8058, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.10', properties FROM pdm.pdm_charge_type WHERE id = 2058;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8059, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.11', properties FROM pdm.pdm_charge_type WHERE id = 2059;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8066, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.12', properties FROM pdm.pdm_charge_type WHERE id = 2066;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8070, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.13', properties FROM pdm.pdm_charge_type WHERE id = 2070;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8112, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.105.1.3.0.14', properties FROM pdm.pdm_charge_type WHERE id = 2112;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8113, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.197.1.1.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2113;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8114, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2114;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8115, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.1.225.2.3.5.6', properties FROM pdm.pdm_charge_type WHERE id = 2115;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8116, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.7.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2116;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8117, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.11.0.3', properties FROM pdm.pdm_charge_type WHERE id = 2117;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8118, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2118;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8119, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2119;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8120, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2120;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8121, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2121;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8125, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.222.3.8.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2125;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8126, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.85.0.5', properties FROM pdm.pdm_charge_type WHERE id = 2126;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8127, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.85.0.6', properties FROM pdm.pdm_charge_type WHERE id = 2127;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8128, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.85.7.3', properties FROM pdm.pdm_charge_type WHERE id = 2128;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8129, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2129;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8130, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2130;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8131, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2131;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8132, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2132;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8133, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2133;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8134, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2134;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8135, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2135;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8136, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2136;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8137, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2137;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8139, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2139;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8140, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.1.225.1.5.0.0', properties FROM pdm.pdm_charge_type WHERE id = 2140;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8141, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2141;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8142, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2142;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8143, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2143;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8144, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.0.0.0.0.0.1', properties FROM pdm.pdm_charge_type WHERE id = 2144;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8145, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.81.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2145;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8146, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.81.0.3', properties FROM pdm.pdm_charge_type WHERE id = 2146;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8147, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.2.0.6', properties FROM pdm.pdm_charge_type WHERE id = 2147;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8148, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.2.0.7', properties FROM pdm.pdm_charge_type WHERE id = 2148;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8149, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.81.0.4', properties FROM pdm.pdm_charge_type WHERE id = 2149;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8150, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.9.225.2.81.0.5', properties FROM pdm.pdm_charge_type WHERE id = 2150;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8151, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.2.0.8', properties FROM pdm.pdm_charge_type WHERE id = 2151;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8152, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.2.0.9', properties FROM pdm.pdm_charge_type WHERE id = 2152;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8153, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.1.8', properties FROM pdm.pdm_charge_type WHERE id = 2153;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8154, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.1.9', properties FROM pdm.pdm_charge_type WHERE id = 2154;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8156, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.1.10', properties FROM pdm.pdm_charge_type WHERE id = 2156;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8157, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.1.11', properties FROM pdm.pdm_charge_type WHERE id = 2157;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8158, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.3.8', properties FROM pdm.pdm_charge_type WHERE id = 2158;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8159, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.3.9', properties FROM pdm.pdm_charge_type WHERE id = 2159;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8160, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.8.225.2.5.3.10', properties FROM pdm.pdm_charge_type WHERE id = 2160;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8161, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.224.2.1.0.16', properties FROM pdm.pdm_charge_type WHERE id = 2161;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8162, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.224.2.1.0.17', properties FROM pdm.pdm_charge_type WHERE id = 2162;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8163, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.224.2.1.0.18', properties FROM pdm.pdm_charge_type WHERE id = 2163;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 8164, name || ' (UnA)', short_name || ' (UnA)', predefined_name, '2.2.224.2.1.0.19', properties FROM pdm.pdm_charge_type WHERE id = 2164;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12136, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.20', properties FROM pdm.pdm_charge_type WHERE id = 2136;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12137, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.21', properties FROM pdm.pdm_charge_type WHERE id = 2137;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12138, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.22', properties FROM pdm.pdm_charge_type WHERE id = 2138;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12145, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.23', properties FROM pdm.pdm_charge_type WHERE id = 2145;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12160, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.24', properties FROM pdm.pdm_charge_type WHERE id = 2160;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12161, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.2.224.2.1.0.25', properties FROM pdm.pdm_charge_type WHERE id = 2161;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 12163, name || ' (FF)', short_name || ' (FF)', predefined_name, '2.9.225.2.4.10.0', properties FROM pdm.pdm_charge_type WHERE id = 2163;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22010, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.8.225.2.14.0.2', properties FROM pdm.pdm_charge_type WHERE id = 2010;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22017, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.8.225.2.14.0.3', properties FROM pdm.pdm_charge_type WHERE id = 2017;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22059, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.1.225.2.3.5.7', properties FROM pdm.pdm_charge_type WHERE id = 2059;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22097, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.1.225.2.3.5.8', properties FROM pdm.pdm_charge_type WHERE id = 2097;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22129, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.9.225.2.4.23.6', properties FROM pdm.pdm_charge_type WHERE id = 2129;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22184, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.9.225.2.4.23.7', properties FROM pdm.pdm_charge_type WHERE id = 2184;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22185, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.26', properties FROM pdm.pdm_charge_type WHERE id = 2185;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22186, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.27', properties FROM pdm.pdm_charge_type WHERE id = 2186;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 22187, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.28', properties FROM pdm.pdm_charge_type WHERE id = 2187;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23047, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.29', properties FROM pdm.pdm_charge_type WHERE id = 2047;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23058, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.30', properties FROM pdm.pdm_charge_type WHERE id = 2058;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23069, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.31', properties FROM pdm.pdm_charge_type WHERE id = 2069;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23070, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.32', properties FROM pdm.pdm_charge_type WHERE id = 2070;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23072, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.2.224.2.1.0.33', properties FROM pdm.pdm_charge_type WHERE id = 2072;
INSERT INTO pdm.pdm_charge_type (id, name, short_name, predefined_name, dis_entity, properties) SELECT 23100, name || ' (STS)', short_name || ' (STS)', predefined_name, '2.9.225.2.84.0.5', properties FROM pdm.pdm_charge_type WHERE id = 2100;
-- Updates to existing Charge Types (OSAG)
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.0' WHERE id=1;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.1' WHERE id=2;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.2' WHERE id=3;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.3' WHERE id=4;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.10.1.0' WHERE id=5;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.9.6.0' WHERE id=6;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.23.1.0' WHERE id=7;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.2.0' WHERE id=8;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.8.0' WHERE id=9;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.0' WHERE id=10;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.5' WHERE id=11;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=12;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.1' WHERE id=13;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.1' WHERE id=14;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.1.0.0' WHERE id=15;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.5.0' WHERE id=16;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.0' WHERE id=17;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.1.2.0' WHERE id=18;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=19;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=20;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.1' WHERE id=21;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.2.8.0' WHERE id=22;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.222.2.2.5.0' WHERE id=23;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.2.0' WHERE id=24;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.21.3.0' WHERE id=25;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.5.0' WHERE id=26;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.2.0' WHERE id=27;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.45.2.23.1.0' WHERE id=28;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.0' WHERE id=29;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.1.0' WHERE id=30;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.0' WHERE id=31;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.1.0' WHERE id=32;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.1.1' WHERE id=33;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.2' WHERE id=34;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.2' WHERE id=35;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.1.0' WHERE id=36;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.2.1.1.0' WHERE id=37;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.3' WHERE id=38;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.2.1' WHERE id=39;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.1' WHERE id=40;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.205.2.1.1.0' WHERE id=41;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.4' WHERE id=42;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.1' WHERE id=43;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.2' WHERE id=44;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.7.0' WHERE id=45;
-- 46/47 unused
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=48;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=49;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.0' WHERE id=50;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.0' WHERE id=51;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=52;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.0' WHERE id=53;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.0.0' WHERE id=54;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=55;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.1.0.0' WHERE id=56;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=57;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.0' WHERE id=58;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=59;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.0' WHERE id=60;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.1' WHERE id=61;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=62;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=63;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.0' WHERE id=64;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=65;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.1' WHERE id=66;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=67;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=68;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=69;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=70;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.1' WHERE id=71;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.1' WHERE id=72;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.1' WHERE id=73;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.2' WHERE id=74;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.78.2.4.0.0' WHERE id=75;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.222.2.3.0.0' WHERE id=76;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.4.0.0' WHERE id=77;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.2' WHERE id=78;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.3' WHERE id=79;
-- Updates to existing Charge Types (ULEIS)
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.0' WHERE id=2001;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.1' WHERE id=2002;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.2' WHERE id=2003;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.3' WHERE id=2004;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.1' WHERE id=2005;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.2' WHERE id=2006;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.3' WHERE id=2007;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.4' WHERE id=2008;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.4' WHERE id=2009;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.5' WHERE id=2010;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.3' WHERE id=2011;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.2' WHERE id=2012;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.3' WHERE id=2013;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.4' WHERE id=2014;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.4' WHERE id=2015;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.5' WHERE id=2016;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.6' WHERE id=2017;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.7' WHERE id=2018;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.5' WHERE id=2019;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.6' WHERE id=2020;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.7' WHERE id=2021;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.0' WHERE id=2022;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.1' WHERE id=2023;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.0' WHERE id=2024;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.1' WHERE id=2025;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.2' WHERE id=2026;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.3' WHERE id=2027;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.4' WHERE id=2028;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.5' WHERE id=2029;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.2' WHERE id=2030;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.3' WHERE id=2031;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.4' WHERE id=2032;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.5' WHERE id=2033;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.0' WHERE id=2034;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.1' WHERE id=2035;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.2' WHERE id=2036;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.3' WHERE id=2037;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.4' WHERE id=2038;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.5' WHERE id=2039;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.6' WHERE id=2040;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.7' WHERE id=2041;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.8' WHERE id=2042;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.9' WHERE id=2043;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.10' WHERE id=2044;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.11' WHERE id=2045;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.12' WHERE id=2046;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.13' WHERE id=2047;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.14' WHERE id=2048;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.15' WHERE id=2049;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.0' WHERE id=2050;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.1' WHERE id=2051;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.2' WHERE id=2052;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.3' WHERE id=2053;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.4' WHERE id=2054;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.0' WHERE id=2055;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.1' WHERE id=2056;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.1' WHERE id=2057;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.2' WHERE id=2058;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.3' WHERE id=2059;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.4' WHERE id=2060;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.5' WHERE id=2061;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.6' WHERE id=2062;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.7' WHERE id=2063;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.8' WHERE id=2064;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.0' WHERE id=2065;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.1' WHERE id=2066;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.2' WHERE id=2067;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.3' WHERE id=2068;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.4' WHERE id=2069;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.5' WHERE id=2070;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.0.0' WHERE id=2071;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.0.1' WHERE id=2072;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.0' WHERE id=2073;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.1' WHERE id=2074;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.2' WHERE id=2075;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.0' WHERE id=2076;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.1' WHERE id=2077;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.2' WHERE id=2078;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.3' WHERE id=2079;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.0' WHERE id=2080;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.1' WHERE id=2081;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.2' WHERE id=2082;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.3' WHERE id=2083;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.4' WHERE id=2084;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.5' WHERE id=2085;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.6' WHERE id=2086;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.7' WHERE id=2087;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.8' WHERE id=2088;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.9' WHERE id=2089;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.0' WHERE id=2090;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.1' WHERE id=2091;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.2' WHERE id=2092;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.5' WHERE id=2093;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.6' WHERE id=2094;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.7' WHERE id=2095;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.8' WHERE id=2096;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.9' WHERE id=2097;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.10' WHERE id=2098;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.11' WHERE id=2099;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.12' WHERE id=2100;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.0' WHERE id=2101;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.1' WHERE id=2102;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.2' WHERE id=2103;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.3' WHERE id=2104;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.4' WHERE id=2105;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.5' WHERE id=2106;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.10' WHERE id=2107;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.11' WHERE id=2108;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.12' WHERE id=2109;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.14.0.0' WHERE id=2110;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.14.0.1' WHERE id=2111;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.6.0.0' WHERE id=2112;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.1.11.0.0' WHERE id=2113;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.10.0.0' WHERE id=2114;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.11.0.0' WHERE id=2115;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.13.0.0' WHERE id=2116;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.0' WHERE id=2117;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.1' WHERE id=2118;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.2' WHERE id=2119;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.0' WHERE id=2120;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.1' WHERE id=2121;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.26.0.0' WHERE id=2122;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.45.0.0' WHERE id=2123;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.4.0.0' WHERE id=2124;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.3.0.0' WHERE id=2125;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.3.0.1' WHERE id=2126;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.0' WHERE id=2127;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.1' WHERE id=2128;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.0.0' WHERE id=2129;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.0' WHERE id=2130;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.1' WHERE id=2131;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.0' WHERE id=2132;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.1' WHERE id=2133;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2134;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.2.0.0' WHERE id=2135;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.0' WHERE id=2136;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.1' WHERE id=2137;
UPDATE pdm.pdm_charge_type SET dis_entity='2.4.225.1.6.0.0' WHERE id=2138;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.3.0.0' WHERE id=2139;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.3.0.1' WHERE id=2140;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.2.0' WHERE id=2141;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.3.0' WHERE id=2142;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.0' WHERE id=2143;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.1' WHERE id=2144;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.2' WHERE id=2145;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.0' WHERE id=2146;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.1' WHERE id=2147;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.2.0.0' WHERE id=2148;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.9.0.0' WHERE id=2149;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.0' WHERE id=2150;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.3' WHERE id=2151;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.0' WHERE id=2152;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.4' WHERE id=2153;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.5' WHERE id=2154;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.0.0' WHERE id=2155;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.0.1' WHERE id=2156;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.0' WHERE id=2157;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.1' WHERE id=2158;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.9' WHERE id=2159;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.10' WHERE id=2160;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.11' WHERE id=2161;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.12' WHERE id=2162;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.13' WHERE id=2163;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.14' WHERE id=2164;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.197.1.1.0.0' WHERE id=2165;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2166;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.6' WHERE id=2167;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.7.0.0' WHERE id=2168;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.3' WHERE id=2169;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2170;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2171;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2172;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2173;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.2' WHERE id=2174;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.5' WHERE id=2175;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.6' WHERE id=2176;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.7.3' WHERE id=2177;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2178;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2179;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2180;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2181;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2182;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2183;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2184;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2185;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2186;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2187;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.1.5.0.0' WHERE id=2188;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2189;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2190;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2191;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2192;
-- Artillery
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.8.18.0' WHERE id=381;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.71.2.13.0.0' WHERE id=382;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.2.19.1.0' WHERE id=371;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.2.19.10.0' WHERE id=372;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.2.19.0.0' WHERE id=374;
UPDATE pdm.pdm_charge_type SET dis_entity='1.1.45.4.3.0.0' WHERE id=373;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.73.0.0' WHERE id=482;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.74.0.0' WHERE id=483;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.75.0.0' WHERE id=484;
-- Nuclear / Chemical
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.6.3.3.0' WHERE id=343; -- Warning: DIS Code Used twice "Chemical Persistant" = VX
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.6.3.3.0' WHERE id=342; -- Warning: DIS Code Used twice "Chemical Persistant" = S-Lost
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.6.3.3.1' WHERE id=341;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.6.3.1.0' WHERE id=321; -- Warnung: Used twice Nuclear Persistant
-- UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.6.3.1.1' WHERE id=321; -- Warning: Used twice Nuclear Drifting (not implemented on RHM side)
-- Mines // Not yet complete...
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.3.1.1.0' WHERE id=214;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.3.3.0.0' WHERE id=215;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.3.3.0.0' WHERE id=216;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,28 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: update PDM Gear Type fr Puma
-- PROJECT: Guez
-- DATE: 2021-08-09
-- VERSION: 1.19
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
INSERT INTO pdm.pdm_gear_type (id, tas_code, name, gear_class_id) VALUES (1082, 82, 'MK 30', 10);
INSERT INTO pdm.pdm_gear_type (id, tas_code, name, gear_class_id) VALUES (1084, 84, 'Koax MG', 10);
INSERT INTO pdm.pdm_gear_type (id, tas_code, name, gear_class_id) VALUES (1087, 87, 'MELLS', 10);
INSERT INTO pdm.pdm_translation (iso_code, disambiguation, context, key, translation) VALUES ('en_GB', 'name', 'GearType', 'MK 30', 'MC 30');
INSERT INTO pdm.pdm_translation (iso_code, disambiguation, context, key, translation) VALUES ('en_GB', 'name', 'GearType', 'Koax MG', 'Coax MG');
INSERT INTO pdm.pdm_translation (iso_code, disambiguation, context, key, translation) VALUES ('en_GB', 'name', 'GearType', 'MELLS', 'MELLS');
INSERT INTO pdm.pdm_can_component_string (name, bit_mask, can_device_id, sub_device_id) VALUES ('AGDUS aktiv', 0, 31, -1);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,20 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: new indexes on eem_event table (on sample_time and event_type) to optimize search (SVN 54364)
-- PROJECT: Guez
-- DATE: 2021-08-12
-- VERSION: 1.20
-------------------------------------------------------------------------
-- GLOBAL: NONE;
BEGIN;
COMMIT;
-- EXERCISE: ALL;
BEGIN;
CREATE INDEX IDX_eem_event_sample_time ON eem_event (sample_time);
CREATE INDEX IDX_eem_event_event_type_id ON eem_event (event_type_id);
COMMIT;
@@ -0,0 +1,38 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM and EX BLD Bridge modifications
-- PROJECT: Guez
-- DATE: 2021-08-17
-- VERSION: 1.21
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
INSERT INTO ism_structure_element_type (id, name) VALUES (11, 'Bridge');
COMMIT;
-- EXERCISE: ALL;
BEGIN;
ALTER TABLE IF EXISTS rec_bridge_status DROP CONSTRAINT IF EXISTS PK_rec_bridge_status_rec_id CASCADE;
ALTER TABLE IF EXISTS rec_bridge_status DROP CONSTRAINT IF EXISTS IDX_rec_bridge_status_sample_time CASCADE;
DROP TABLE IF EXISTS rec_bridge_status CASCADE;
CREATE TABLE IF NOT EXISTS rec_bridge_status (
id integer,
name text,
is_deleted boolean,
is_used boolean,
sample_time bigint,
building_id integer,
status integer,
rec_id bigint DEFAULT nextval(( 'rec_bridge_status_rec_id_seq'::text)::regclass),
dds_is_alive boolean DEFAULT true,
insert_time bigint DEFAULT (extract(epoch from now()) * 1000)
);
COMMENT ON TABLE rec_bridge_status IS 'recorded data for topic BridgeStatus';
CREATE SEQUENCE IF NOT EXISTS rec_bridge_status_rec_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS rec_bridge_status ADD CONSTRAINT PK_rec_bridge_status_rec_id PRIMARY KEY (rec_id);
CREATE INDEX IDX_rec_bridge_status_sample_time ON rec_bridge_status (sample_time);
COMMIT;
@@ -0,0 +1,106 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add ISM changes from Resource Management branch
-- PROJECT: Guez
-- DATE: 2021-08-17
-- VERSION: 1.22
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
ALTER TABLE IF EXISTS ism_mounting_point_plan DROP CONSTRAINT IF EXISTS FK_ism_mounting_point_plan_mounting_point_state_ism_mounting_po CASCADE;
ALTER TABLE IF EXISTS ism_mounting_point_schedule DROP CONSTRAINT IF EXISTS FK_ism_mounting_point_schedule_status_id_ism_schedule_status_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status DROP CONSTRAINT IF EXISTS PK_ism_schedule_status_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS PK_ism_schedule_status_change_id CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS FK_ism_schedule_status_change_schedule_id_ism_mounting_point_sc CASCADE;
ALTER TABLE IF EXISTS ism_schedule_status_change DROP CONSTRAINT IF EXISTS FK_ism_schedule_status_change_schedule_status_id_ism_schedule_s CASCADE;
DROP TABLE IF EXISTS ism_schedule_status CASCADE;
DROP TABLE IF EXISTS ism_schedule_status_change CASCADE;
CREATE TABLE IF NOT EXISTS ism_schedule_status (
id integer DEFAULT nextval(( 'ism.ism_schedule_status_id_seq'::text)::regclass),
name text
);
CREATE TABLE IF NOT EXISTS ism_schedule_status_change (
id integer DEFAULT nextval(( 'ism.ism_schedule_status_change_id_seq'::text)::regclass),
schedule_id integer,
schedule_status_id integer,
changed_at bigint,
operator_id integer,
workstation_id integer
);
COMMENT ON TABLE ism_schedule_status_change IS 'instrumentation plan status changes';
ALTER TABLE ism_mounting_point_plan ADD COLUMN IF NOT EXISTS mounting_point_state integer DEFAULT 0;
COMMENT ON COLUMN ism_mounting_point_plan.mounting_point_state IS '(-1, 0, 1) - (Empty, Idle, Equipped)';
DELETE FROM ism_mounting_point_state WHERE id = -1;
INSERT INTO ism_mounting_point_state (id, name) VALUES (-1, 'Empty');
INSERT INTO ism_schedule_status (id, name) VALUES (0, 'Unknown');
INSERT INTO ism_schedule_status (id, name) VALUES (1, 'Created');
INSERT INTO ism_schedule_status (id, name) VALUES (2, 'Prepared');
INSERT INTO ism_schedule_status (id, name) VALUES (3, 'Activated');
INSERT INTO ism_schedule_status (id, name) VALUES (4, 'Expired');
INSERT INTO ism_schedule_status (id, name) VALUES (5, 'Removed');
CREATE SEQUENCE IF NOT EXISTS ism_schedule_status_id_seq INCREMENT 1 START 1 MINVALUE 1;
CREATE SEQUENCE IF NOT EXISTS ism_schedule_status_change_id_seq INCREMENT 1 START 1 MINVALUE 1;
ALTER TABLE IF EXISTS ism_schedule_status ADD CONSTRAINT PK_ism_schedule_status_id PRIMARY KEY (id);
ALTER TABLE IF EXISTS ism_schedule_status_change ADD CONSTRAINT PK_ism_schedule_status_change_id PRIMARY KEY (id);
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS status_id INTEGER;
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS time_created bigint DEFAULT (extract(epoch from now()) * 1000);
ALTER TABLE ism_mounting_point_schedule ADD COLUMN IF NOT EXISTS time_prepared bigint;
COMMENT ON COLUMN ism_mounting_point_schedule.time_start IS 'time activated';
COMMENT ON COLUMN ism_mounting_point_schedule.time_end IS 'time expired';
ALTER TABLE ism_mounting_point_schedule ADD CONSTRAINT FK_ism_mounting_point_schedule_status_id_ism_schedule_status_id FOREIGN KEY (status_id) REFERENCES ism_schedule_status (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_schedule_status_change ADD CONSTRAINT FK_ism_schedule_status_change_schedule_id_ism_mounting_point_sc FOREIGN KEY (schedule_id) REFERENCES ism_mounting_point_schedule (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_schedule_status_change ADD CONSTRAINT FK_ism_schedule_status_change_schedule_status_id_ism_schedule_s FOREIGN KEY (schedule_status_id) REFERENCES ism_schedule_status (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ism_mounting_point_plan ADD CONSTRAINT FK_ism_mounting_point_plan_mounting_point_state_ism_mounting_po FOREIGN KEY (mounting_point_state) REFERENCES ism_mounting_point_state (id) ON DELETE CASCADE ON UPDATE CASCADE;
-- DROP INDEX IF EXISTS IDX_ism_mounting_point_plan_mounting_point_schedule_id CASCADE;
CREATE INDEX IF NOT EXISTS IDX_ism_mounting_point_plan_mounting_point_schedule_id ON ism_mounting_point_plan (mounting_point_schedule_id);
UPDATE ism_mounting_point_schedule SET status_id = 1 WHERE status_id IS null;
-- Notify functions for callbacks (signals in db interface) - needed for copySchedule
CREATE OR REPLACE FUNCTION public.ism_notifyInsertMainSchedule()
RETURNS TRIGGER AS $$
DECLARE
toNotify RECORD;
toReturn RECORD;
BEGIN
IF (TG_OP = 'INSERT') THEN
toNotify = NEW;
toReturn = NEW;
ELSIF (TG_OP = 'UPDATE') THEN
toNotify = OLD;
toReturn = NEW;
ELSIF (TG_OP = 'DELETE') THEN
toNotify = OLD;
toReturn = OLD;
END IF;
PERFORM pg_notify('notifyInsertMainSchedule', CAST(toNotify.id AS text));
RETURN toReturn;
END;
$$ LANGUAGE plpgsql;
-- Notify function trigger for callbacks (signals in db interface) - needed for copySchedule
DROP TRIGGER IF EXISTS trg_ai_notifyInsertMainSchedule ON ism_mounting_point_schedule;
CREATE TRIGGER trg_ai_notifyInsertMainSchedule
AFTER INSERT ON ism_mounting_point_schedule FOR EACH ROW EXECUTE PROCEDURE public.ism_notifyInsertMainSchedule();
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+65
View File
@@ -0,0 +1,65 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Add 6 Guez bridges with footprints
-- PROJECT: Guez
-- DATE: 2021-09-03
-- VERSION: 1.23
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
-- Main structure elements
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (201, 'Brücke_1', 'Brücke', 0.20244350, 0.91600840, 89, 75, 1000, 0, '{"bridgeStatus": 1}');
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (202, 'Brücke_2', 'Brücke', 0.20249532, 0.91604629, 89, 48, 1000, 0, '{"bridgeStatus": 1}');
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (203, 'Brücke_3', 'Brücke', 0.20254068, 0.91606124, 92, 59, 1000, 0, '{"bridgeStatus": 1}');
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (204, 'Brücke_4', 'Brücke', 0.20259702, 0.91609599, 93, 72, 1000, 0, '{"bridgeStatus": 1}');
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (205, 'Brücke_5', 'Brücke', 0.20261578, 0.91610101, 92, 19, 1000, 0, '{"bridgeStatus": 1}');
INSERT INTO ism.ism_main_structure_element (id, name, description, geo_position_x, geo_position_y, geo_position_z, angle, model_id, external_wls_id, properties)
VALUES (206, 'Brücke_6', 'Brücke', 0.20263897, 0.91610447, 91, 340, 1000, 0, '{"bridgeStatus": 1}');
-- Structure elements
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (32, 'BridgeProxy 1', 201, 11, '{32}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 1');
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (34, 'BridgeProxy 2', 202, 11, '{34}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 2');
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (36, 'BridgeProxy 3', 203, 11, '{36}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 3');
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (38, 'BridgeProxy 4', 204, 11, '{38}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 4');
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (40, 'BridgeProxy 5', 205, 11, '{40}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 5');
INSERT INTO ism.ism_structure_element (id, name, main_structure_element_id, structure_element_type_id, path, mounting_point_id, barcode, rel_position_x, rel_position_y, rel_position_z, mounting_point_type_id, orientation_x, orientation_y, orientation_z, properties, display_name) VALUES (42, 'BridgeProxy 6', 206, 11, '{42}', 0, '', 0, 0, 0, 0, 0, 0, 0, '{}', 'Brücke 6');
-- Footprints
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (32, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (32, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (32, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (32, 3, 5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (34, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (34, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (34, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (34, 3, 5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (36, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (36, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (36, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (36, 3, 5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (38, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (38, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (38, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (38, 3, 5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (40, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (40, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (40, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (40, 3, 5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (42, 0, -5, -10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (42, 1, -5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (42, 2, 5, 10, 0);
INSERT INTO ism.ism_structure_element_footprint (structure_element_id, index_no, rel_position_x, rel_position_y, rel_position_z) VALUES (42, 3, 5, -10, 0);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+38
View File
@@ -0,0 +1,38 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Puma VBA changes
-- PROJECT: Guez
-- DATE: 2021-08-26
-- VERSION: 1.24
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063233, 4, 'Funk defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063234, 4, 'Funkantenne defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063235, 4, 'Funktion defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063236, 4, 'Aufbau defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063237, 4, 'Ladung zerstört');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063238, 4, 'Personal ausgefallen');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063239, 4, 'Turm beschädigt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063240, 4, 'Ausfall MELLS Anbausatz');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063241, 4, 'Kette defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063242, 4, 'Motor defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063243, 4, 'Kettenantrieb defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063244, 4, 'Periskop defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063245, 4, 'Turmantrieb defekt');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063246, 4, 'Hauptwaffe ausgefallen');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063247, 4, 'Keine Wirkung');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063248, 4, 'Reaktiv GÜZ');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063249, 4, 'Reaktiv SR');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063250, 4, 'Totalausfall');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063251, 4, 'Übungspause');
INSERT INTO pdm.pdm_vulnerability_kind (player_type_class_id, ta_vulnerability_kind, vulnerability_class_id, name) VALUES (4, 4063252, 4, 'Übungsunterbrechung');
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
@@ -0,0 +1,428 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Disentities for all charge types
-- PROJECT: Guez
-- DATE: 2021-08-27
-- VERSION: 1.25
-------------------------------------------------------------------------
-- GLOBAL: PDM;
BEGIN;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.0' WHERE id=1;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.1' WHERE id=2;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.2' WHERE id=3;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.3' WHERE id=4;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.10.1.0' WHERE id=5;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.9.6.0' WHERE id=6;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.23.1.0' WHERE id=7;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.2.0' WHERE id=8;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.8.0' WHERE id=9;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.0' WHERE id=10;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.5' WHERE id=11;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=12;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.1' WHERE id=13;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.1' WHERE id=14;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.1.0.0' WHERE id=15;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.5.0' WHERE id=16;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.0' WHERE id=17;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.1.2.0' WHERE id=18;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=19;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=20;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.1' WHERE id=21;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.2.8.0' WHERE id=22;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.222.2.2.5.0' WHERE id=23;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.2.0' WHERE id=24;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.21.3.0' WHERE id=25;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.5.0' WHERE id=26;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.2.0' WHERE id=27;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.45.2.23.1.0' WHERE id=28;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.0' WHERE id=29;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.1.0' WHERE id=30;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.0' WHERE id=31;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.1.0' WHERE id=32;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.206.2.1.1.1' WHERE id=33;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.2' WHERE id=34;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.2' WHERE id=35;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.1.0' WHERE id=36;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.2.1.1.0' WHERE id=37;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.3' WHERE id=38;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.2.1' WHERE id=39;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.1' WHERE id=40;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.205.2.1.1.0' WHERE id=41;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.4' WHERE id=42;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.1' WHERE id=43;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.2.1.2' WHERE id=44;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.7.0' WHERE id=45;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.6' WHERE id=48;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.7' WHERE id=49;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.0' WHERE id=50;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.0' WHERE id=51;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.11' WHERE id=52;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.0' WHERE id=53;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.0.0' WHERE id=54;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=55;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.1.0.0' WHERE id=56;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.1.0.1' WHERE id=57;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.0' WHERE id=58;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.1' WHERE id=59;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.0' WHERE id=60;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.1' WHERE id=61;
UPDATE pdm.pdm_charge_type SET dis_entity='1.1.78.0.0.1' WHERE id=62;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.20' WHERE id=63;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.0' WHERE id=64;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.1' WHERE id=65;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.1' WHERE id=66;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=67;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.8' WHERE id=68;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.9' WHERE id=69;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.10' WHERE id=70;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.1' WHERE id=71;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.1' WHERE id=72;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.1' WHERE id=73;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.2' WHERE id=74;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.78.2.4.0.0' WHERE id=75;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.222.2.3.0.0' WHERE id=76;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.4.0.0' WHERE id=77;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.2' WHERE id=78;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.0.3' WHERE id=79;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.0' WHERE id=2001;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.1' WHERE id=2002;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.2' WHERE id=2003;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.3' WHERE id=2004;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.1' WHERE id=2005;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.2' WHERE id=2006;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.3' WHERE id=2007;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.81.0.4' WHERE id=2008;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.4' WHERE id=2009;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.5' WHERE id=2010;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.3' WHERE id=2011;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.2' WHERE id=2012;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.3' WHERE id=2013;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.4' WHERE id=2014;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.4' WHERE id=2015;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.5' WHERE id=2016;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.6' WHERE id=2017;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.7' WHERE id=2018;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.5' WHERE id=2019;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.6' WHERE id=2020;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.7' WHERE id=2021;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.0' WHERE id=2022;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.1' WHERE id=2023;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.0' WHERE id=2024;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.1' WHERE id=2025;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.2' WHERE id=2026;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.3' WHERE id=2027;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.4' WHERE id=2028;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.5' WHERE id=2029;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.2' WHERE id=2030;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.3' WHERE id=2031;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.4' WHERE id=2032;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.5' WHERE id=2033;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.0' WHERE id=2034;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.1' WHERE id=2035;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.2' WHERE id=2036;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.3' WHERE id=2037;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.4' WHERE id=2038;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.5' WHERE id=2039;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.6' WHERE id=2040;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.7' WHERE id=2041;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.8' WHERE id=2042;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.9' WHERE id=2043;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.10' WHERE id=2044;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.11' WHERE id=2045;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.12' WHERE id=2046;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.13' WHERE id=2047;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.14' WHERE id=2048;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.15' WHERE id=2049;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.0' WHERE id=2050;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.1' WHERE id=2051;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.2' WHERE id=2052;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.3' WHERE id=2053;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.4' WHERE id=2054;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.0' WHERE id=2055;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.1' WHERE id=2056;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.1' WHERE id=2057;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.2' WHERE id=2058;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.3' WHERE id=2059;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.4' WHERE id=2060;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.5' WHERE id=2061;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.6' WHERE id=2062;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.7' WHERE id=2063;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.8' WHERE id=2064;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.0' WHERE id=2065;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.1' WHERE id=2066;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.2' WHERE id=2067;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.3' WHERE id=2068;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.4' WHERE id=2069;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.5' WHERE id=2070;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.0.0' WHERE id=2071;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.0.1' WHERE id=2072;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.0' WHERE id=2073;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.1' WHERE id=2074;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.5.0.2' WHERE id=2075;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.0' WHERE id=2076;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.1' WHERE id=2077;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.2' WHERE id=2078;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.3' WHERE id=2079;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.0' WHERE id=2080;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.1' WHERE id=2081;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.2' WHERE id=2082;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.3' WHERE id=2083;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.4' WHERE id=2084;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.5' WHERE id=2085;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.6' WHERE id=2086;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.7' WHERE id=2087;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.8' WHERE id=2088;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.9' WHERE id=2089;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.0' WHERE id=2090;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.1' WHERE id=2091;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.2' WHERE id=2092;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.5' WHERE id=2093;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.6' WHERE id=2094;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.7' WHERE id=2095;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.8' WHERE id=2096;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.9' WHERE id=2097;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.10' WHERE id=2098;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.11' WHERE id=2099;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.12' WHERE id=2100;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.0' WHERE id=2101;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.1' WHERE id=2102;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.2' WHERE id=2103;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.2.11.0.3' WHERE id=2104;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.4' WHERE id=2105;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.5' WHERE id=2106;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.10' WHERE id=2107;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.11' WHERE id=2108;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.12' WHERE id=2109;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.14.0.0' WHERE id=2110;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.14.0.1' WHERE id=2111;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.6.0.0' WHERE id=2112;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.1.11.0.0' WHERE id=2113;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.10.0.0' WHERE id=2114;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.11.0.0' WHERE id=2115;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.13.0.0' WHERE id=2116;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.0' WHERE id=2117;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.1' WHERE id=2118;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.2' WHERE id=2119;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.0' WHERE id=2120;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.1' WHERE id=2121;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.26.0.0' WHERE id=2122;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.45.0.0' WHERE id=2123;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.4.0.0' WHERE id=2124;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.3.0.0' WHERE id=2125;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.3.0.1' WHERE id=2126;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.0' WHERE id=2127;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.1' WHERE id=2128;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.0.0' WHERE id=2129;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.0' WHERE id=2130;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.1' WHERE id=2131;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.0' WHERE id=2132;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.1' WHERE id=2133;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2134;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.2.0.0' WHERE id=2135;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.0' WHERE id=2136;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.1' WHERE id=2137;
UPDATE pdm.pdm_charge_type SET dis_entity='2.4.225.1.6.0.0' WHERE id=2138;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.3.0.0' WHERE id=2139;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.3.0.1' WHERE id=2140;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.2.0' WHERE id=2141;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.3.0' WHERE id=2142;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.0' WHERE id=2143;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.1' WHERE id=2144;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.2' WHERE id=2145;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.0' WHERE id=2146;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.1' WHERE id=2147;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.2.0.0' WHERE id=2148;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.9.0.0' WHERE id=2149;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.0' WHERE id=2150;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.3' WHERE id=2151;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.0' WHERE id=2152;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.4' WHERE id=2153;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.5' WHERE id=2154;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.0.0' WHERE id=2155;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.0.1' WHERE id=2156;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.0' WHERE id=2157;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.1' WHERE id=2158;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.9' WHERE id=2159;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.10' WHERE id=2160;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.11' WHERE id=2161;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.12' WHERE id=2162;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.13' WHERE id=2163;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.14' WHERE id=2164;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.197.1.1.0.0' WHERE id=2165;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.0.3.4.0.0' WHERE id=2166;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.6' WHERE id=2167;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.7.0.0' WHERE id=2168;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.3' WHERE id=2169;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.8' WHERE id=2170;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.9' WHERE id=2171;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.10' WHERE id=2172;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.11' WHERE id=2173;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.3.8.0.2' WHERE id=2174;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.5' WHERE id=2175;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.6' WHERE id=2176;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.7.3' WHERE id=2177;
UPDATE pdm.pdm_charge_type SET dis_entity='9.1.225.5.9.0' WHERE id=2178;
UPDATE pdm.pdm_charge_type SET dis_entity='9.1.225.5.7.0' WHERE id=2179;
UPDATE pdm.pdm_charge_type SET dis_entity='9.1.225.5.60.0' WHERE id=2180;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2181;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2182;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2183;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.1.0.1' WHERE id=2184;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.1' WHERE id=2185;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2186;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2187;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.1.5.0.0' WHERE id=2188;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2189;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2190;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2191;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=2192;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.2' WHERE id=4001;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.3' WHERE id=4002;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.6' WHERE id=4003;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.7' WHERE id=4004;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.4' WHERE id=4007;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.81.0.5' WHERE id=4008;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.8' WHERE id=4009;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.9' WHERE id=4010;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.8' WHERE id=4015;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.9' WHERE id=4016;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.10' WHERE id=4017;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.11' WHERE id=4018;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.8' WHERE id=4019;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.9' WHERE id=4020;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.3.10' WHERE id=4021;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.16' WHERE id=4034;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.17' WHERE id=4035;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.18' WHERE id=4036;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.19' WHERE id=4037;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.20' WHERE id=4038;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.21' WHERE id=4040;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.22' WHERE id=4041;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.23' WHERE id=4042;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.24' WHERE id=4044;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.25' WHERE id=4045;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.10.0' WHERE id=6022;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.2' WHERE id=6024;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.14.0.3' WHERE id=6025;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.7' WHERE id=6026;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.2.3.5.8' WHERE id=6027;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.6' WHERE id=6030;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.4.23.7' WHERE id=6031;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.26' WHERE id=6036;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.27' WHERE id=6039;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.28' WHERE id=6040;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.29' WHERE id=6043;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.30' WHERE id=6044;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.31' WHERE id=6045;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.32' WHERE id=6047;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.33' WHERE id=6048;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.5' WHERE id=6051;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.84.0.6' WHERE id=6053;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.7.0.1' WHERE id=6055;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.9' WHERE id=6057;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.10' WHERE id=6060;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.2' WHERE id=6065;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.39.0.3' WHERE id=6069;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.6' WHERE id=6077;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.13' WHERE id=6081;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.14' WHERE id=6085;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.15' WHERE id=6086;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.4' WHERE id=6091;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.16' WHERE id=6096;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.5' WHERE id=6097;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.6' WHERE id=6103;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.9.0.7' WHERE id=6105;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.10.0.17' WHERE id=6107;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.3' WHERE id=6110;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.2' WHERE id=6121;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.8' WHERE id=6170;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.9' WHERE id=6171;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.10' WHERE id=6172;
UPDATE pdm.pdm_charge_type SET dis_entity='5.1.0.5.30.11' WHERE id=6173;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.7' WHERE id=6175;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.85.0.8' WHERE id=6176;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=6191;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.6.0.0' WHERE id=8056;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.11' WHERE id=8058;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.12' WHERE id=8059;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.10.0.0' WHERE id=8066;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.2.11.0.0' WHERE id=8070;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.6.0.0' WHERE id=8112;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.222.1.11.0.1' WHERE id=8113;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.10.0.1' WHERE id=8114;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.11.0.1' WHERE id=8115;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.13.0.1' WHERE id=8116;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.4' WHERE id=8117;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.5' WHERE id=8118;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.14.0.6' WHERE id=8119;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.3' WHERE id=8120;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.222.1.16.0.4' WHERE id=8121;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.4.0.1' WHERE id=8125;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.4.0.2' WHERE id=8126;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.2' WHERE id=8127;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.16.0.3' WHERE id=8128;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.0.1' WHERE id=8129;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.2' WHERE id=8130;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.4.3' WHERE id=8131;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.2' WHERE id=8132;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.5.3' WHERE id=8133;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=8134;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.2.0.1' WHERE id=8135;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.2' WHERE id=8136;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.3' WHERE id=8137;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=8139;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=8140;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.2.1' WHERE id=8141;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.4.3.1' WHERE id=8142;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.3' WHERE id=8143;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.4' WHERE id=8144;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.5' WHERE id=8145;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.2' WHERE id=8146;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.2.0.3' WHERE id=8147;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.71.1.2.0.1' WHERE id=8148;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.9.0.1' WHERE id=8149;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.4' WHERE id=8150;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.1.5' WHERE id=8151;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.6' WHERE id=8152;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.7' WHERE id=8153;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.2.8' WHERE id=8154;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.0.2' WHERE id=8156;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.2' WHERE id=8157;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.1.1.3.3' WHERE id=8158;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.15' WHERE id=8159;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.16' WHERE id=8160;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.17' WHERE id=8161;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.18' WHERE id=8162;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.19' WHERE id=8163;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.20' WHERE id=8164;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.4' WHERE id=12136;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.8.0.5' WHERE id=12137;
UPDATE pdm.pdm_charge_type SET dis_entity='2.1.225.1.15.0.0' WHERE id=12138;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.1.5.0.6' WHERE id=12145;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.21' WHERE id=12160;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.22' WHERE id=12161;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.105.1.3.0.23' WHERE id=12163;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.2.0.10' WHERE id=22010;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.12' WHERE id=22017;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.13' WHERE id=22059;
UPDATE pdm.pdm_charge_type SET dis_entity='2.9.225.2.11.0.7' WHERE id=22097;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.225.1.1.0.2' WHERE id=22129;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.1.0.1' WHERE id=22184;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.5.1.1' WHERE id=22185;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=22186;
UPDATE pdm.pdm_charge_type SET dis_entity='2.0.0.0.0.0.1' WHERE id=22187;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.1.0.34' WHERE id=23047;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.205.2.2.6.14' WHERE id=23058;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.6' WHERE id=23069;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.224.2.7.0.7' WHERE id=23070;
UPDATE pdm.pdm_charge_type SET dis_entity='2.2.78.2.9.0.2' WHERE id=23072;
UPDATE pdm.pdm_charge_type SET dis_entity='2.8.225.2.16.0.13' WHERE id=23100;
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
+87
View File
@@ -0,0 +1,87 @@
-- $Id$
-- $HeadURL$
-- $Author$
-------------------------------------------------------------------------
-- INFO: Delete double entries from assets
-- PROJECT: Guez
-- DATE: 2021-09-16
-- VERSION: 1.26
-------------------------------------------------------------------------
-- GLOBAL: ISM;
BEGIN;
-- GSM
DELETE FROM ism.ism_asset WHERE id IN (121, 103, 104, 105, 106, 107, 108,109, 110, 111,112, 122, 113, 114, 115, 116, 117, 118, 119, 120);
-- OUTDOOR CAMERAS
DELETE FROM ism.ism_asset WHERE id IN (201, 202, 203);
-- INDOOR CAMERAS
DELETE FROM ism.ism_asset WHERE id IN (2943, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,135, 136, 137, 138);
-- BUILDING SENSOR MODULE
DELETE FROM ism.ism_asset WHERE id IN (1, 3779);
-- Only if necessary
-- DELETE FROM ism.ism_asset WHERE mounting_point_type_id = 2;
INSERT INTO ism.ism_mounting_point_type (id, name) VALUES (14, 'BuildingNetworkSwitch');
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020001_80206045020001_020001', 14, 'GV__80206045020001_80206045020001_020001','UEPOGV-0001', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020002_80206045020002_020002', 14, 'GV__80206045020002_80206045020002_020002','UEPOGV-0002', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020003_80206045020003_020003', 14, 'GV__80206045020003_80206045020003_020003','UEPOGV-0003', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020004_80206045020004_020004', 14, 'GV__80206045020004_80206045020004_020004','UEPOGV-0004', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020005_80206045020005_020005', 14, 'GV__80206045020005_80206045020005_020005','UEPOGV-0005', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045020006_80206045020006_020006', 14, 'GV__80206045020006_80206045020006_020006','UEPOGV-0006', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030007_80206045030007_030007', 14, 'GV__80206045030007_80206045030007_030007','UEPOGV-0007', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030008_80206045030008_030008', 14, 'GV__80206045030008_80206045030008_030008','UEPOGV-0008', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030009_80206045030009_030009', 14, 'GV__80206045030009_80206045030009_030009','UEPOGV-0009', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030010_80206045030010_030010', 14, 'GV__80206045030010_80206045030010_030010','UEPOGV-0010', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030011_80206045030011_030011', 14, 'GV__80206045030011_80206045030011_030011','UEPOGV-0011', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030012_80206045030012_030012', 14, 'GV__80206045030012_80206045030012_030012','UEPOGV-0012', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030013_80206045030013_030013', 14, 'GV__80206045030013_80206045030013_030013','UEPOGV-0013', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030014_80206045030014_030014', 14, 'GV__80206045030014_80206045030014_030014','UEPOGV-0014', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030015_80206045030015_030015', 14, 'GV__80206045030015_80206045030015_030015','UEPOGV-0015', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030016_80206045030016_030016', 14, 'GV__80206045030016_80206045030016_030016','UEPOGV-0016', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030017_80206045030017_030017', 14, 'GV__80206045030017_80206045030017_030017','UEPOGV-0017', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030018_80206045030018_030018', 14, 'GV__80206045030018_80206045030018_030018','UEPOGV-0018', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030019_80206045030019_030019', 14, 'GV__80206045030019_80206045030019_030019','UEPOGV-0019', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030020_80206045030020_030020', 14, 'GV__80206045030020_80206045030020_030020','UEPOGV-0020', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030021_80206045030021_030021', 14, 'GV__80206045030021_80206045030021_030021','UEPOGV-0021', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030022_80206045030022_030022', 14, 'GV__80206045030022_80206045030022_030022','UEPOGV-0022', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030023_80206045030023_030023', 14, 'GV__80206045030023_80206045030023_030023','UEPOGV-0023', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030024_80206045030024_030024', 14, 'GV__80206045030024_80206045030024_030024','UEPOGV-0024', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030025_80206045030025_030025', 14, 'GV__80206045030025_80206045030025_030025','UEPOGV-0025', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030026_80206045030026_030026', 14, 'GV__80206045030026_80206045030026_030026','UEPOGV-0026', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030027_80206045030027_030027', 14, 'GV__80206045030027_80206045030027_030027','UEPOGV-0027', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030028_80206045030028_030028', 14, 'GV__80206045030028_80206045030028_030028','UEPOGV-0028', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030029_80206045030029_030029', 14, 'GV__80206045030029_80206045030029_030029','UEPOGV-0029', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030030_80206045030030_030030', 14, 'GV__80206045030030_80206045030030_030030','UEPOGV-0030', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030031_80206045030031_030031', 14, 'GV__80206045030031_80206045030031_030031','UEPOGV-0031', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030032_80206045030032_030032', 14, 'GV__80206045030032_80206045030032_030032','UEPOGV-0032', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030033_80206045030033_030033', 14, 'GV__80206045030033_80206045030033_030033','UEPOGV-0033', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030034_80206045030034_030034', 14, 'GV__80206045030034_80206045030034_030034','UEPOGV-0034', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030035_80206045030035_030035', 14, 'GV__80206045030035_80206045030035_030035','UEPOGV-0035', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030036_80206045030036_030036', 14, 'GV__80206045030036_80206045030036_030036','UEPOGV-0036', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030037_80206045030037_030037', 14, 'GV__80206045030037_80206045030037_030037','UEPOGV-0037', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030038_80206045030038_030038', 14, 'GV__80206045030038_80206045030038_030038','UEPOGV-0038', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030039_80206045030039_030039', 14, 'GV__80206045030039_80206045030039_030039','UEPOGV-0039', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030040_80206045030040_030040', 14, 'GV__80206045030040_80206045030040_030040','UEPOGV-0040', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030041_80206045030041_030041', 14, 'GV__80206045030041_80206045030041_030041','UEPOGV-0041', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030042_80206045030042_030042', 14, 'GV__80206045030042_80206045030042_030042','UEPOGV-0042', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030043_80206045030043_030043', 14, 'GV__80206045030043_80206045030043_030043','UEPOGV-0043', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030044_80206045030044_030044', 14, 'GV__80206045030044_80206045030044_030044','UEPOGV-0044', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030045_80206045030045_030045', 14, 'GV__80206045030045_80206045030045_030045','UEPOGV-0045', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030046_80206045030046_030046', 14, 'GV__80206045030046_80206045030046_030046','UEPOGV-0046', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030047_80206045030047_030047', 14, 'GV__80206045030047_80206045030047_030047','UEPOGV-0047', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030048_80206045030048_030048', 14, 'GV__80206045030048_80206045030048_030048','UEPOGV-0048', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030049_80206045030049_030049', 14, 'GV__80206045030049_80206045030049_030049','UEPOGV-0049', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030050_80206045030050_030050', 14, 'GV__80206045030050_80206045030050_030050','UEPOGV-0050', 0);
INSERT INTO ism.ism_asset (name, mounting_point_type_id, barcode, hostname, asset_state_id) VALUES ('GV__80206045030051_80206045030051_030051', 14, 'GV__80206045030051_80206045030051_030051','UEPOGV-0051', 0);
COMMIT;
-- EXERCISE: NONE;
BEGIN;
COMMIT;
Loaded 100 of 16245 files, more files were not shown because too many files have changed in this diff. Show more