Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
989c31ca
Commit
989c31ca
authored
Oct 23, 2020
by
Ryan Herbert
Committed by
Mikaël Salson
Nov 20, 2020
Browse files
add index creation on auth_permission
parent
56235507
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/models/db.py
View file @
989c31ca
...
...
@@ -289,11 +289,14 @@ db.define_table('tag_ref',
Field
(
'table_name'
,
'string'
),
Field
(
'record_id'
,
'integer'
))
# try to create an index on these un-indexed columns, if it fails, we assume they already exist
try
:
db
.
executesql
(
'CREATE INDEX table_name_index ON tag_ref (table_name);'
)
db
.
executesql
(
'CREATE INDEX record_id_index ON tag_ref (record_id);'
)
db
.
executesql
(
'CREATE INDEX name_index ON auth_permission (name);'
)
db
.
executesql
(
'CREATE INDEX record_id_index ON auth_permission (record_id);'
)
except
:
pass
pass
## after defining tables, uncomment below to enable auditing
auth
.
enable_record_versioning
(
db
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment