Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Remove old takes and payroll table
Browse files Browse the repository at this point in the history
Time to let go.
  • Loading branch information
chadwhitacre committed May 11, 2016
1 parent 77fd818 commit fbdb0b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
26 changes: 0 additions & 26 deletions gratipay/models/participant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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("""
Expand Down Expand Up @@ -1519,8 +1495,6 @@ def take_over(self, account, have_confirmation=False):

if this_is_others_last_login_account:

other.clear_takes(cursor)

# Take over tips.
# ===============

Expand Down
13 changes: 13 additions & 0 deletions sql/branch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@ CREATE TRIGGER enforce_email_for_participant_identity
-- participants.has_verified_identity

ALTER TABLE participants ADD COLUMN has_verified_identity bool NOT NULL DEFAULT false;


-- 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;

0 comments on commit fbdb0b3

Please sign in to comment.