From a608f561c48bf247e313f383e6f806f10d70f253 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 8 Jan 2008 10:28:49 +0000 Subject: * added new DB-table 'installed_plugin', moving schema version to 0.21 * added functionality to DB-layer for adding, removing and fetching plugins that have been installed into a vendor-OS. * added a set of tests related to installed plugins. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1447 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/DBSchema.pm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'config-db/OpenSLX/DBSchema.pm') diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm index cd92c07e..dc55b1b7 100644 --- a/config-db/OpenSLX/DBSchema.pm +++ b/config-db/OpenSLX/DBSchema.pm @@ -38,7 +38,7 @@ use POSIX qw(locale_h); my $lang = setlocale(LC_MESSAGES); my $country = $lang =~ m[^\w\w_(\w\w)] ? lc($1) : 'us'; -my $VERSION = 0.2; +my $VERSION = 0.21; my $DbSchema = { 'version' => $VERSION, @@ -152,6 +152,19 @@ my $DbSchema = { 'system_id:fk', # foreign key ], }, + 'installed_plugin' => { + # holds the plugins that have been installed into a specific + # vendor-OS + 'cols' => [ + 'id:pk', # primary key + 'vendor_os_id:fk', # foreign key + 'plugin_name:s.64', # name of installed plugin + # (e.g. suse-9.3-kde, debian-3.1-ppc, + # suse-10.2-cloned-from-kiwi). + # This is used as the folder name for the + # corresponding stage1, too. + ], + }, 'meta' => { # information about the database as such 'cols' => [ @@ -630,4 +643,24 @@ sub _upgradeDBTo0_2 return 1; } +sub _upgradeDBTo0_21 +{ + my $self = shift; + my $metaDB = shift; + + # move attributes into separate tables ... + # + # ... system attributes ... + $metaDB->schemaAddTable( + 'installed_plugin', + [ + 'id:pk', + 'vendor_os_id:fk', + 'plugin_name:s.64', + ] + ); + + return 1; +} + 1; -- cgit v1.2.3-55-g7522