diff --git a/sql/database-create.sql b/sql/database-create.sql index 0fb6f93011bf9cd7a80ef192856b4fa38608e88e..b68e025c2989fdcce4fc770a137597d6c45915b3 100644 --- a/sql/database-create.sql +++ b/sql/database-create.sql @@ -130,6 +130,7 @@ CREATE TABLE `apt_profiles` ( `version` int(8) unsigned NOT NULL default '0', `pid` varchar(48) NOT NULL default '', `pid_idx` mediumint(8) unsigned NOT NULL default '0', + `uuid` varchar(40) NOT NULL, `public` tinyint(1) NOT NULL default '0', `shared` tinyint(1) NOT NULL default '0', `listed` tinyint(1) NOT NULL default '0', diff --git a/sql/updates/4/400 b/sql/updates/4/400 new file mode 100644 index 0000000000000000000000000000000000000000..b4ad3d698d59d8bcec0cd125a34959872a023112 --- /dev/null +++ b/sql/updates/4/400 @@ -0,0 +1,21 @@ +# +# Update to profiles. +# +use strict; +use libdb; + +sub DoUpdate($$$) +{ + my ($dbhandle, $dbname, $version) = @_; + + if (!DBSlotExists("apt_profiles", "uuid")) { + DBQueryFatal("ALTER TABLE apt_profiles ADD ". + " `uuid` varchar(40) NOT NULL after pid_idx"); + DBQueryFatal("update apt_profiles set uuid=uuid()"); + } + return 0; +} + +# Local Variables: +# mode:perl +# End: