1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//---------------------------------------------------------------------------
#ifdef __BORLANDC__
#pragma hdrstop
#endif
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "DatabaseUi.h"
#include <sstream>
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
namespace MediaConch {
//***************************************************************************
// Database
//***************************************************************************
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
//---------------------------------------------------------------------------
DatabaseUi::DatabaseUi()
{
}
//---------------------------------------------------------------------------
DatabaseUi::~DatabaseUi()
{
}
//---------------------------------------------------------------------------
void DatabaseUi::set_database_directory(const std::string& dirname)
{
Database::set_database_directory(dirname);
}
//---------------------------------------------------------------------------
void DatabaseUi::set_database_filename(const std::string& filename)
{
Database::set_database_filename(filename);
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_create_ui_table(std::string& q)
{
std::stringstream create;
create << "CREATE TABLE IF NOT EXISTS UI "; // Table name
create << "(FILENAME TEXT NOT NULL,";
create << " FILEPATH TEXT NOT NULL,";
create << " POLICY INT NOT NULL,";
create << " DISPLAY INT NOT NULL,";
create << " ANALYZED BOOL NOT NULL,";
create << " IMPLEMENTATION_VALID BOOL ,";
create << " POLICY_VALID BOOL );";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_table_v0(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI "; // Table name
create << "ADD VERBOSITY INT DEFAULT -1 NOT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_create_ui_settings_table(std::string& q)
{
std::stringstream create;
create << "CREATE TABLE IF NOT EXISTS UI_SETTINGS "; // Table name
create << "(USER_ID INT PRIMARY KEY DEFAULT -1,";
create << " DEFAULT_POLICY TEXT NOT NULL,";
create << " DEFAULT_DISPLAY TEXT NOT NULL,";
create << " DEFAULT_VERBOSITY INT NOT NULL);";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v1(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_POLICY TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v2(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_DISPLAY TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v3(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_VERBOSITY INT DEFAULT 5;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v4(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_SAVE_REPORT_PATH TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v5(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_LOAD_FILES_PATH TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v6(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_SAVE_REPORT_PATH TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v7(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_LOAD_FILES_PATH TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v8(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_SAVE_POLICY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_SAVE_DISPLAY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_SAVE_POLICY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_SAVE_DISPLAY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_LOAD_POLICY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_LOAD_DISPLAY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_LOAD_POLICY_PATH TEXT DEFAULT NULL;";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_LOAD_DISPLAY_PATH TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v9(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD MCO_TOKEN TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_table_v10(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI"; // Table name
create << " ADD OPTIONS TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_table_v11(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI"; // Table name
create << " ADD MIL_VERSION INT DEFAULT 0;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_table_v12(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI"; // Table name
create << " ADD POLICY_HAS_INFO BOOL DEFAULT FALSE;";
create << "ALTER TABLE UI"; // Table name
create << " ADD POLICY_HAS_WARNING BOOL DEFAULT FALSE;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v13(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DEFAULT_PARSESPEED TEXT NOT NULL DEFAULT 'last';";
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD LAST_PARSESPEED TEXT DEFAULT NULL;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_table_v14(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI"; // Table name
create << " ADD IMPLEMENTATION_HAS_INFO BOOL DEFAULT FALSE;";
create << "ALTER TABLE UI"; // Table name
create << " ADD IMPLEMENTATION_HAS_WARNING BOOL DEFAULT FALSE;";
q = create.str();
}
//---------------------------------------------------------------------------
void DatabaseUi::get_sql_query_for_update_ui_settings_table_v15(std::string& q)
{
std::stringstream create;
create << "ALTER TABLE UI_SETTINGS"; // Table name
create << " ADD DISPLAYCAPTIONS_OPTION TEXT DEFAULT NULL;";
q = create.str();
}
}
|