Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/sql/mymoneystoragesql.cpp
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Line(s) | 245 | { | |||
---|---|---|---|---|---|
247 | // initialize record counts and hi ids | 247 | // initialize record counts and hi ids | ||
248 | d->m_institutions = d->m_accounts = d->m_payees = d->m_tags = d->m_transactions = d->m_splits | 248 | d->m_institutions = d->m_accounts = d->m_payees = d->m_tags = d->m_transactions = d->m_splits | ||
249 | = d->m_securities = d->m_prices = d->m_currencies = d->m_schedules = d->m_reports = d->m_kvps = d->m_budgets = 0; | 249 | = d->m_securities = d->m_prices = d->m_currencies = d->m_schedules = d->m_reports = d->m_kvps = d->m_budgets = 0; | ||
250 | d->m_hiIdInstitutions = d->m_hiIdPayees = d->m_hiIdTags = d->m_hiIdAccounts = d->m_hiIdTransactions = | 250 | d->m_hiIdInstitutions = d->m_hiIdPayees = d->m_hiIdTags = d->m_hiIdAccounts = d->m_hiIdTransactions = | ||
251 | d->m_hiIdSchedules = d->m_hiIdSecurities = d->m_hiIdReports = d->m_hiIdBudgets = 0; | 251 | d->m_hiIdSchedules = d->m_hiIdSecurities = d->m_hiIdReports = d->m_hiIdBudgets = 0; | ||
252 | d->m_onlineJobs = d->m_payeeIdentifier = 0; | 252 | d->m_onlineJobs = d->m_payeeIdentifier = 0; | ||
253 | d->m_displayStatus = true; | 253 | d->m_displayStatus = true; | ||
254 | try { | 254 | try { | ||
255 | if (this->driverName().compare(QLatin1String("QSQLITE")) == 0) { | ||||
256 | QSqlQuery query(*this); | ||||
257 | query.exec("PRAGMA foreign_keys = ON"); // this is needed for "ON UPDATE" and "ON DELETE" to work | ||||
258 | } | ||||
259 | | ||||
255 | MyMoneyDbTransaction t(*this, Q_FUNC_INFO); | 260 | MyMoneyDbTransaction t(*this, Q_FUNC_INFO); | ||
256 | d->writeInstitutions(); | 261 | d->writeInstitutions(); | ||
257 | d->writePayees(); | 262 | d->writePayees(); | ||
258 | d->writeTags(); | 263 | d->writeTags(); | ||
259 | d->writeAccounts(); | 264 | d->writeAccounts(); | ||
260 | d->writeTransactions(); | 265 | d->writeTransactions(); | ||
261 | d->writeSchedules(); | 266 | d->writeSchedules(); | ||
262 | d->writeSecurities(); | 267 | d->writeSecurities(); | ||
▲ Show 20 Lines • Show All 2589 Lines • Show Last 20 Lines |