digiKam
similaritydbschemaupdater.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2017-06-30
7  * Description : Similarity DB schema update
8  *
9  * Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2010-2017 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2017 by Swati Lodha <swatilodha27 at gmail dot com>
12  * Copyright (C) 2018 by Mario Frank <mario dot frank at uni minus potsdam dot de>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_SIMILARITY_DB_SCHEMA_UPDATER_H
28 #define DIGIKAM_SIMILARITY_DB_SCHEMA_UPDATER_H
29 
30 namespace Digikam
31 {
32 
33 class SimilarityDbAccess;
34 class InitializationObserver;
35 
37 {
38 public:
39 
40  static int schemaVersion();
41 
42 public:
43 
44  explicit SimilarityDbSchemaUpdater(SimilarityDbAccess* const dbAccess);
46 
47  bool update();
48  void setObserver(InitializationObserver* const observer);
49 
50 private:
51 
52  bool startUpdates();
53  bool makeUpdates();
54  bool createDatabase();
55  bool createTables();
56  bool createIndices();
57  bool createTriggers();
58  bool updateV1ToV2();
59 
60 private:
61 
62  // Disable
64  SimilarityDbSchemaUpdater& operator=(const SimilarityDbSchemaUpdater&) = delete;
65 
66  class Private;
67  Private* const d;
68 };
69 
70 } // namespace Digikam
71 
72 #endif // DIGIKAM_SIMILARITY_DB_SCHEMA_UPDATER_H
Definition: collectionscannerobserver.h:57
Definition: similaritydbaccess.h:45
Definition: similaritydbschemaupdater.h:37
bool update()
Definition: similaritydbschemaupdater.cpp:94
~SimilarityDbSchemaUpdater()
Definition: similaritydbschemaupdater.cpp:89
static int schemaVersion()
Definition: similaritydbschemaupdater.cpp:50
void setObserver(InitializationObserver *const observer)
Definition: similaritydbschemaupdater.cpp:114
SimilarityDbSchemaUpdater(SimilarityDbAccess *const dbAccess)
Definition: similaritydbschemaupdater.cpp:83
Definition: datefolderview.cpp:43