summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-08-08 13:34:58 -0700
committerShawn O. Pearce <sop@google.com>2009-08-08 13:40:18 -0700
commit1262c8649e2b5af11b80e6f44680d41206549ba7 (patch)
tree4ff95156442a01c5aaf4f3795e66b62cb4228382
parenteb128d0c256ad036f75097d708a16dc056417e66 (diff)
Unset use_contributor_agreements if agreements are disabled
Receive changed to honor only the project use_contributor_agreement setting, which means that if the flag is set on a project but there are no agreements in the database for a user to agree to, then all uploads would fail. Since no agreements is a very typical setting we have to ensure the flag is false on those systems. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--Documentation/project-setup.txt2
-rw-r--r--src/main/webapp/WEB-INF/sql/upgrade015_016_part1_mysql.sql7
-rw-r--r--src/main/webapp/WEB-INF/sql/upgrade015_016_part1_postgres.sql7
3 files changed, 15 insertions, 1 deletions
diff --git a/Documentation/project-setup.txt b/Documentation/project-setup.txt
index c48a906cc3..420e30b18c 100644
--- a/Documentation/project-setup.txt
+++ b/Documentation/project-setup.txt
@@ -47,7 +47,7 @@ for a project named `project`.
,name)
VALUES
(nextval('project_id')
- ,'Y'
+ ,'N'
,'M'
,'new/project');
diff --git a/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_mysql.sql b/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_mysql.sql
index a796bc39d3..cb842e3280 100644
--- a/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_mysql.sql
+++ b/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_mysql.sql
@@ -1,6 +1,13 @@
-- Upgrade: schema_version 15 to 16 (MySQL)
--
+-- Unset contributor agreement flag if site doesn't use them.
+--
+UPDATE projects SET use_contributor_agreements = 'N'
+WHERE use_contributor_agreements = 'Y'
+AND NOT EXISTS (SELECT 1 FROM contributor_agreements);
+
+
-- account_project_watches
--
DELETE FROM account_project_watches WHERE project_id NOT IN (SELECT project_id FROM projects);
diff --git a/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_postgres.sql b/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_postgres.sql
index ac89e54cf8..d3fe363b2d 100644
--- a/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_postgres.sql
+++ b/src/main/webapp/WEB-INF/sql/upgrade015_016_part1_postgres.sql
@@ -1,6 +1,13 @@
-- Upgrade: schema_version 15 to 16 (PostgreSQL)
--
+-- Unset contributor agreement flag if site doesn't use them.
+--
+UPDATE projects SET use_contributor_agreements = 'N'
+WHERE use_contributor_agreements = 'Y'
+AND NOT EXISTS (SELECT 1 FROM contributor_agreements);
+
+
-- account_project_watches
--
DROP INDEX account_project_watches_ntcmt;