{"action":"created","comment":{"url":"https://api.github.com/repos/18F/openFEC/pulls/comments/32872485","id":32872485,"diff_hunk":"@@ -556,3 +556,79 @@ class CommitteeTotalsHouseSenate(CommitteeTotals):\n     other_receipts = db.Column(db.Integer)\n     transfers_from_other_authorized_committee = db.Column(db.Integer)\n     transfers_to_other_authorized_committee = db.Column(db.Integer)\n+\n+\n+class ScheduleA(db.Model):\n+    __tablename__ = 'sched_a'\n+\n+    sched_a_sk = db.Column(db.Integer, primary_key=True)\n+    form_type = db.Column('form_tp', db.String)\n+    committee_id = db.Column('cmte_id', db.String)\n+    committee_name = db.Column('cmte_nm', db.String)\n+    entity_type = db.Column('entity_tp', db.String)\n+    contributor_id = db.Column('contbr_id', db.String)\n+    contributor_name = db.Column('contbr_nm', db.String)\n+    contributor_prefix = db.Column('contbr_prefix', db.String)\n+    contributor_first_name = db.Column('contbr_f_nm', db.String)\n+    contributor_middle_name = db.Column('contbr_m_nm', db.String)\n+    contributor_last_name = db.Column('contbr_l_nm', db.String)\n+    contributor_suffix = db.Column('contbr_suffix', db.String)\n+    contributor_street_1 = db.Column('contbr_st1', db.String)\n+    contributor_street_2 = db.Column('contbr_st2', db.String)\n+    contributor_city = db.Column('contbr_city', db.String)\n+    contributor_state = db.Column('contbr_st', db.String)\n+    contributor_zip = db.Column('contbr_zip', db.String)\n+    election_type = db.Column('election_tp', db.String)\n+    election_type_full = db.Column('election_tp_desc', db.String)\n+    contributor_employer = db.Column('contbr_employer', db.String)\n+    contributor_occupation = db.Column('contbr_occupation', db.String)\n+    contributor_aggregate_ytd = db.Column('contb_aggregate_ytd', db.Float)\n+    contributor_receipt_date = db.Column('contb_receipt_dt', db.DateTime)\n+    contributor_receipt_amount = db.Column('contb_receipt_amt', db.Float)\n+    receipt_type = db.Column('receipt_tp', db.String)\n+    receipt_type_full = db.Column('receipt_desc', db.String)\n+    candidate_id = db.Column('cand_id', db.String)\n+    candidate_name = db.Column('cand_nm', db.String)","path":"webservices/common/models.py","position":36,"original_position":36,"commit_id":"1825800bf9cbd793476c89aae1f88b1406c6f5d5","original_commit_id":"1825800bf9cbd793476c89aae1f88b1406c6f5d5","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"body":"They're not *always* empty, but they're often null or filled with some dummy value.","created_at":"2015-06-19T21:50:36Z","updated_at":"2015-06-19T21:50:36Z","html_url":"https://github.com/18F/openFEC/pull/996#discussion_r32872485","pull_request_url":"https://api.github.com/repos/18F/openFEC/pulls/996","_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC/pulls/comments/32872485"},"html":{"href":"https://github.com/18F/openFEC/pull/996#discussion_r32872485"},"pull_request":{"href":"https://api.github.com/repos/18F/openFEC/pulls/996"}}},"pull_request":{"url":"https://api.github.com/repos/18F/openFEC/pulls/996","id":38146547,"html_url":"https://github.com/18F/openFEC/pull/996","diff_url":"https://github.com/18F/openFEC/pull/996.diff","patch_url":"https://github.com/18F/openFEC/pull/996.patch","issue_url":"https://api.github.com/repos/18F/openFEC/issues/996","number":996,"state":"open","locked":false,"title":"Feature/schedule a","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"body":"Add Schedule A filings to API.\r\n\r\nThe Schedule A table is much larger than the other tables used by the API so far, so the approach we're taking here is different in several ways:\r\n* Instead a materialized view, we're sticking with the original table provided by FEC (`sched_a`). We're adding indexes to this table for performance, but not creating a new table or view.\r\n* To support full-text search on contributor name and employer, we're creating an auxiliary table (`ofec_sched_a_fulltext`) with full-text representations of the relevant fields. This table is kept in sync with `sched_a` using a trigger in postgres.\r\n* Counting all rows in a cursor is prohibitively expensive on tables of this size. We're compromising by using an approximate count for large result sets, based on the results of a much cheaper `EXPLAIN` query. This means that counts will *not* be exactly correct.\r\n* Pagination using `OFFSET` is also too expensive for large tables. Instead, this patch supports pagination by passing the index of the last row in the previous result set. This means we'll be able to fetch the next page in a query, but not seek to an arbitrary page number.\r\n\r\nStill in progress:\r\n* [ ] Restrict sort options to avoid sorting on unindexed columns\r\n* [ ] Discuss and benchmark proposed changes with @arowla \r\n* [ ] Write unit and integration tests","created_at":"2015-06-19T20:49:57Z","updated_at":"2015-06-19T21:50:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23b1f7fc0b7e4b44cb80f812729d6ff758f10e64","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/openFEC/pulls/996/commits","review_comments_url":"https://api.github.com/repos/18F/openFEC/pulls/996/comments","review_comment_url":"https://api.github.com/repos/18F/openFEC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/openFEC/issues/996/comments","statuses_url":"https://api.github.com/repos/18F/openFEC/statuses/1825800bf9cbd793476c89aae1f88b1406c6f5d5","head":{"label":"jmcarp:feature/schedule-a","ref":"feature/schedule-a","sha":"1825800bf9cbd793476c89aae1f88b1406c6f5d5","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"repo":{"id":33560779,"name":"openFEC","full_name":"jmcarp/openFEC","owner":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmcarp/openFEC","description":"An experiment in taking data from the Federal Election Commission and harmonizing/cleaning it up to make it easier for external developers to use and analyze.","fork":true,"url":"https://api.github.com/repos/jmcarp/openFEC","forks_url":"https://api.github.com/repos/jmcarp/openFEC/forks","keys_url":"https://api.github.com/repos/jmcarp/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmcarp/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmcarp/openFEC/teams","hooks_url":"https://api.github.com/repos/jmcarp/openFEC/hooks","issue_events_url":"https://api.github.com/repos/jmcarp/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/jmcarp/openFEC/events","assignees_url":"https://api.github.com/repos/jmcarp/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/jmcarp/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/jmcarp/openFEC/tags","blobs_url":"https://api.github.com/repos/jmcarp/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmcarp/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmcarp/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmcarp/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmcarp/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/jmcarp/openFEC/languages","stargazers_url":"https://api.github.com/repos/jmcarp/openFEC/stargazers","contributors_url":"https://api.github.com/repos/jmcarp/openFEC/contributors","subscribers_url":"https://api.github.com/repos/jmcarp/openFEC/subscribers","subscription_url":"https://api.github.com/repos/jmcarp/openFEC/subscription","commits_url":"https://api.github.com/repos/jmcarp/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmcarp/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmcarp/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmcarp/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmcarp/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/jmcarp/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmcarp/openFEC/merges","archive_url":"https://api.github.com/repos/jmcarp/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmcarp/openFEC/downloads","issues_url":"https://api.github.com/repos/jmcarp/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/jmcarp/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/jmcarp/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/jmcarp/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmcarp/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/jmcarp/openFEC/releases{/id}","created_at":"2015-04-07T18:28:37Z","updated_at":"2015-04-07T18:28:38Z","pushed_at":"2015-06-19T20:40:29Z","git_url":"git://github.com/jmcarp/openFEC.git","ssh_url":"git@github.com:jmcarp/openFEC.git","clone_url":"https://github.com/jmcarp/openFEC.git","svn_url":"https://github.com/jmcarp/openFEC","homepage":null,"size":29801,"stargazers_count":0,"watchers_count":0,"language":"SQLPL","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"18F:develop","ref":"develop","sha":"b2145e4c759ab0051afbc095d7c46e63160ecc2f","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":23116127,"name":"openFEC","full_name":"18F/openFEC","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/openFEC","description":"An experiment in taking data from the Federal Election Commission and harmonizing/cleaning it up to make it easier for external developers to use and analyze.","fork":false,"url":"https://api.github.com/repos/18F/openFEC","forks_url":"https://api.github.com/repos/18F/openFEC/forks","keys_url":"https://api.github.com/repos/18F/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/openFEC/teams","hooks_url":"https://api.github.com/repos/18F/openFEC/hooks","issue_events_url":"https://api.github.com/repos/18F/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/18F/openFEC/events","assignees_url":"https://api.github.com/repos/18F/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/18F/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/18F/openFEC/tags","blobs_url":"https://api.github.com/repos/18F/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/openFEC/languages","stargazers_url":"https://api.github.com/repos/18F/openFEC/stargazers","contributors_url":"https://api.github.com/repos/18F/openFEC/contributors","subscribers_url":"https://api.github.com/repos/18F/openFEC/subscribers","subscription_url":"https://api.github.com/repos/18F/openFEC/subscription","commits_url":"https://api.github.com/repos/18F/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/18F/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/openFEC/merges","archive_url":"https://api.github.com/repos/18F/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/openFEC/downloads","issues_url":"https://api.github.com/repos/18F/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/18F/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/18F/openFEC/releases{/id}","created_at":"2014-08-19T15:51:14Z","updated_at":"2015-06-17T00:28:20Z","pushed_at":"2015-06-19T21:49:35Z","git_url":"git://github.com/18F/openFEC.git","ssh_url":"git@github.com:18F/openFEC.git","clone_url":"https://github.com/18F/openFEC.git","svn_url":"https://github.com/18F/openFEC","homepage":null,"size":31699,"stargazers_count":54,"watchers_count":54,"language":"PLpgSQL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":114,"forks":12,"open_issues":114,"watchers":54,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC/pulls/996"},"html":{"href":"https://github.com/18F/openFEC/pull/996"},"issue":{"href":"https://api.github.com/repos/18F/openFEC/issues/996"},"comments":{"href":"https://api.github.com/repos/18F/openFEC/issues/996/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/openFEC/pulls/996/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/openFEC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/openFEC/pulls/996/commits"},"statuses":{"href":"https://api.github.com/repos/18F/openFEC/statuses/1825800bf9cbd793476c89aae1f88b1406c6f5d5"}}}}