Add database versioning and upgrading.
authorJan Cybulski <j.cybulski@samsung.com>
Fri, 8 Nov 2013 13:42:04 +0000 (14:42 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 21 Nov 2013 15:57:53 +0000 (16:57 +0100)
commit34cced40f601bc77261937ab5b4361c9823b3947
tree6dd395897a74d6d8cb21372d47a1b7e48cd5999d
parent8acd4c5b1db2a04226b3fd4193547fafca814bca
Add database versioning and upgrading.

[Issue#]       SSDWSSP-615
[Bug/Feature]  Database upgrade was not possible without data loss.
[Cause]        N/A

[Solution]     Enable database upgrading by sequential calling upgrade
               sql scripts.
               Also, move all sql files to /usr/share/privilege-control/.

[Verification] -Remove one of the update files *-to-v2.sql in /db/updates,
               build and check if %check script properly detects lack of
               that file (build should stop with error).
               -Add that file again.
               -Build newest libprivilege-control (this)
                        and libprivilege-control-0.0.58
                        and libprivilege-control-0.0.59.
               -Install libprivilege-control-0.0.58, and then install newest.
               -Should install without problems. Run tests.
               -Remove database, install V59, and then install newest.
               -Should install without problems, Run tests.
               -Remove database, install newest.
               -Should install without problems, Run tests.

Change-Id: I5b232cba86c252d3ba2ac2e5432dcad816790823
CMakeLists.txt
db/rules-db-sql-udf.c
db/rules-db.sql
db/updater.sh [new file with mode: 0755]
db/updates/update-rules-db-data-to-v2.sql [new file with mode: 0644]
db/updates/update-rules-db-data-to-v3.sql [new file with mode: 0644]
db/updates/update-rules-db-to-v2.sql [new file with mode: 0644]
db/updates/update-rules-db-to-v3.sql [new file with mode: 0644]
packaging/libprivilege-control.spec
smack-rules.service