Skip to content

Commit

Permalink
Adjust indexes for system tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyrumple committed Jun 18, 2022
1 parent b41a149 commit 9905615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web2py/applications/smc/controllers/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,9 @@ def pull_from_youtube_download_queue_count():
response.view = 'generic.json'

download_queue_count = db(db.media_files.needs_downloading==True).count()
#print(f"LastSQL: {db._lastsql} - {db._timings}")
db.commit()


return download_queue_count

Expand Down
8 changes: 8 additions & 0 deletions web2py/applications/smc/models/x_app_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,14 @@
Field("fill_in_the_blank_answer", "string", default=""),
)


# Indexes - Add indexes for system tables
if db_init_needed:
db.executesql('CREATE INDEX IF NOT EXISTS auth_membership_idx ON auth_membership (id, user_id, group_id);')
db.executesql('CREATE INDEX IF NOT EXISTS auth_group_idx ON auth_group (id, role);')
db.executesql('CREATE INDEX IF NOT EXISTS auth_user_idx ON auth_user (id, username, email, first_name, last_name);')


# Adjust the app logo if it is set
app_logo = AppSettings.GetValue('app_logo', '<none>')
if app_logo != "<none>":
Expand Down

0 comments on commit 9905615

Please sign in to comment.