Skip to content

Commit

Permalink
bug 869270 - backfill_matviews populates product_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer committed May 9, 2013
1 parent 8a0f04f commit b3449fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions socorro/external/postgresql/fakedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,5 @@ class ReportPartitionInfo(BaseTable):
ProductProductidMap, ReleaseRepositories, CrontabberState,
CrashTypes, ReportPartitionInfo]

# FIXME this could be built up from BaseTable's releases dict, instead
featured_versions = ('5.0a1', '4.0a2', '3.1b1', '2.1')
6 changes: 4 additions & 2 deletions socorro/external/postgresql/setupdb_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ def generate_fakedata(db2, fakedata_days):
io.seek(0)
db2.bulk_load(io, table.table, table.columns, '\t')

db2.session.execute("SELECT backfill_matviews(cast(:start as DATE),"
" cast(:end as DATE))",
dict(zip(["start", "end"], list((start_date, end_date)))))

db2.session.execute("UPDATE product_versions SET featured_version = TRUE"
" WHERE version_string IN ("
":one, :two, :three, :four)",
dict(zip(["one", "two", "three", "four"],
list(fakedata.featured_versions))))
db2.session.execute("SELECT backfill_matviews(cast(:start as DATE), cast(:end as DATE))",
dict(zip(["start", "end"], list((start_date, end_date)))))

def main(self):

Expand Down

0 comments on commit b3449fb

Please sign in to comment.