digiKam
facedbschemaupdater.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 : 2009-05-29
7  * Description : Face database schema updater
8  *
9  * Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2020 by Nghia Duong <minhnghiaduong997 at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_FACE_DB_SCHEMA_UPDATER_H
27 #define DIGIKAM_FACE_DB_SCHEMA_UPDATER_H
28 
29 // Local includes
30 
32 
33 namespace Digikam
34 {
35 
36 class FaceDbAccess;
37 
39 {
40 public:
41 
42  static int schemaVersion();
43 
44 public:
45 
46  explicit FaceDbSchemaUpdater(FaceDbAccess* const dbAccess);
48 
49  bool update();
50  void setObserver(InitializationObserver* const observer);
51 
52 private:
53 
54  bool startUpdates();
55  bool makeUpdates();
56  bool createDatabase();
57  bool createTables();
58  bool createIndices();
59  bool createTriggers();
60  bool updateV1ToV2();
61  bool updateV2ToV3();
62  bool updateV3ToV4();
63 
64 private:
65 
66  // Disable
68  FaceDbSchemaUpdater& operator=(const FaceDbSchemaUpdater&) = delete;
69 
70 private:
71 
72  class Private;
73  Private* const d;
74 };
75 
76 } // namespace Digikam
77 
78 #endif // DIGIKAM_FACE_DB_SCHEMA_UPDATER_H
Definition: facedbaccess.h:43
Definition: facedbschemaupdater.h:39
void setObserver(InitializationObserver *const observer)
Definition: facedbschemaupdater.cpp:83
~FaceDbSchemaUpdater()
Definition: facedbschemaupdater.cpp:78
FaceDbSchemaUpdater(FaceDbAccess *const dbAccess)
Definition: facedbschemaupdater.cpp:72
static int schemaVersion()
Definition: facedbschemaupdater.cpp:42
bool update()
Definition: facedbschemaupdater.cpp:88
Definition: collectionscannerobserver.h:57
Definition: datefolderview.cpp:43