From 9141c149fc0afdb47da346090231010e2b22f063 Mon Sep 17 00:00:00 2001 From: Leigh B Stoller Date: Mon, 30 Nov 2015 14:19:38 -0700 Subject: [PATCH] Add disabled flag to profile (versions). Code to follow. --- sql/database-fill.sql | 1 + sql/updates/4/485 | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 sql/updates/4/485 diff --git a/sql/database-fill.sql b/sql/database-fill.sql index 85e73d525..753bc94c8 100644 --- a/sql/database-fill.sql +++ b/sql/database-fill.sql @@ -1311,6 +1311,7 @@ REPLACE INTO table_regex VALUES ('apt_profiles','public','int','redirect','defau REPLACE INTO table_regex VALUES ('apt_profiles','listed','int','redirect','default:boolean',0,0,NULL); REPLACE INTO table_regex VALUES ('apt_profiles','shared','int','redirect','default:boolean',0,0,NULL); REPLACE INTO table_regex VALUES ('apt_profiles','topdog','int','redirect','default:boolean',0,0,NULL); +REPLACE INTO table_regex VALUES ('apt_profiles','disabled','int','redirect','default:boolean',0,0,NULL); REPLACE INTO table_regex VALUES ('apt_profiles','description','text','redirect','default:html_fulltext',0,512,NULL); REPLACE INTO table_regex VALUES ('apt_profiles','rspec','text','redirect','default:html_fulltext',0,262143,NULL); REPLACE INTO table_regex VALUES ('apt_profiles','script','text','redirect','default:html_fulltext',0,65535,NULL); diff --git a/sql/updates/4/485 b/sql/updates/4/485 new file mode 100644 index 000000000..0e9e713dc --- /dev/null +++ b/sql/updates/4/485 @@ -0,0 +1,26 @@ +use strict; +use libdb; + +sub DoUpdate($$$) +{ + my ($dbhandle, $dbname, $version) = @_; + + if (!DBSlotExists("apt_profiles", "disabled")) { + DBQueryFatal("alter table apt_profiles add ". + " `disabled` tinyint(1) NOT NULL default '0' ". + " after topdog"); + } + if (!DBSlotExists("apt_profile_versions", "disabled")) { + DBQueryFatal("alter table apt_profile_versions add ". + " `disabled` tinyint(1) NOT NULL default '0' ". + " after deleted"); + } + DBQueryFatal("REPLACE INTO table_regex VALUES ". + " ('apt_profiles','disabled','int','redirect',". + " 'default:boolean',0,0,NULL)"); + return 0; +} + +# Local Variables: +# mode:perl +# End: -- GitLab