Skip to content

Commit

Permalink
Add multi-project-admin sql and some TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Holda committed Mar 26, 2012
1 parent 03ac8aa commit 016b849
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/project.py
Expand Up @@ -523,6 +523,7 @@ def setAdmin(self, b):
projectUser = self.orm.query(models.ProjectMember).get((userId, projectId))

# TODO prevent last admin from being deleted
# TODO on delete of creator, make oldest admin creator

if projectUser:
projectUser.is_project_admin = b
Expand Down
2 changes: 2 additions & 0 deletions sql/migrations/0008_add_is_project_creator.sql
@@ -0,0 +1,2 @@
alter table project__user add column is_project_creator tinyint(1) NOT NULL DEFAULT '0' after is_project_admin;
update project__user set is_project_creator = 1 where is_project_admin = 1;
1 change: 1 addition & 0 deletions sql/models.sql
Expand Up @@ -471,6 +471,7 @@ CREATE TABLE `project__user` (
`project_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`is_project_admin` tinyint(1) NOT NULL DEFAULT '0',
`is_project_creator` tinyint(1) NOT NULL DEFAULT '0',
`created_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`project_id`,`user_id`)
) ENGINE=MyISAM;
Expand Down

0 comments on commit 016b849

Please sign in to comment.