digiKam
thumbsdbschemaupdater.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 : Thumbnail DB schema update
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  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_THUMBS_DB_SCHEMA_UPDATER_H
26 #define DIGIKAM_THUMBS_DB_SCHEMA_UPDATER_H
27 
28 // Local includes
29 
30 #include "digikam_export.h"
31 
32 namespace Digikam
33 {
34 
35 class ThumbsDbAccess;
36 class InitializationObserver;
37 
38 class DIGIKAM_EXPORT ThumbsDbSchemaUpdater
39 {
40 public:
41 
42  static int schemaVersion();
43 
44 public:
45 
46  explicit ThumbsDbSchemaUpdater(ThumbsDbAccess* 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 
63 private:
64 
65  // Disable
67  ThumbsDbSchemaUpdater& operator=(const ThumbsDbSchemaUpdater&) = delete;
68 
69  class Private;
70  Private* const d;
71 };
72 
73 } // namespace Digikam
74 
75 #endif // DIGIKAM_THUMBS_DB_SCHEMA_UPDATER_H
Definition: collectionscannerobserver.h:57
Definition: thumbsdbaccess.h:43
Definition: thumbsdbschemaupdater.h:39
Definition: datefolderview.cpp:43