diff --git a/gratipay/models/participant/__init__.py b/gratipay/models/participant/__init__.py index 4bd8a127db..cdc4d76884 100644 --- a/gratipay/models/participant/__init__.py +++ b/gratipay/models/participant/__init__.py @@ -334,14 +334,6 @@ def clear_payment_instructions(self, cursor): self.set_payment_instruction(team, '0.00', update_self=False, cursor=cursor) - def clear_takes(self, cursor): - """Leave all teams by zeroing all takes. - """ - for team, nmembers in self.get_old_teams(): - t = Participant.from_username(team) - t.set_take_for(self, Decimal(0), self, cursor) - - def clear_personal_information(self, cursor): """Clear personal information such as statements. """ @@ -1095,22 +1087,6 @@ def get_teams(self, only_approved=False, cursor=None): return teams - def get_old_teams(self): - """Return a list of old-style teams this user was a member of. - """ - return self.db.all(""" - - SELECT team AS name - , ( SELECT count(*) - FROM current_takes - WHERE team=x.team - ) AS nmembers - FROM current_takes x - WHERE member=%s; - - """, (self.username,)) - - def insert_into_communities(self, is_member, name, slug): participant_id = self.id self.db.run(""" @@ -1528,8 +1504,6 @@ def take_over(self, account, have_confirmation=False): if this_is_others_last_login_account: - other.clear_takes(cursor) - # Take over tips. # =============== diff --git a/sql/branch.sql b/sql/branch.sql new file mode 100644 index 0000000000..e291338d6e --- /dev/null +++ b/sql/branch.sql @@ -0,0 +1,11 @@ +-- https://github.com/gratipay/gratipay.com/pull/4009 + +BEGIN; + -- Farewell, old takes table! + DROP VIEW current_takes; + DROP TABLE takes; + + -- Be gone, payroll! I never knew you. + DROP VIEW current_payroll; + DROP TABLE payroll; +END;