diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2015-02-02 15:33:42 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-10-06 09:09:24 +0100 |
commit | 657177eba893c29d6d3f9e4b9f4f24ede5b78bc4 (patch) | |
tree | d26ebbf2474beb467c8f9eff591ab71628de6464 /db | |
parent | 735536dc5e269f2094d122e49f2c648928db4acb (diff) |
Add "time spent" admin logging.
Mechanism is general, but current implementation only used
for Zurich.
- Zurich: Record time_spent field mysociety/FixMyStreet-Commercial#676
- template changes (including jQuery spinner)
- backend changes to save data are made:
- in log_edit, if supplied
- and time on category change (and arbitrary actions)
- Add update_admin_log to all paths for DM, ensuring that it gets called,
while resetting the `time_spent` parameter, to make sure that
there is never a duplicate record created.
- Also quell warning about using DateTime values in query.
- Also add (seemingly unrelated) parens to stop misparsing of OK line in
questionnaire test now that DT::Format::Pg is used in Zurich cobrand
See mysociety/FixMyStreet-Commercial#676
Diffstat (limited to 'db')
-rw-r--r-- | db/downgrade_0038---0037.sql | 2 | ||||
-rw-r--r-- | db/schema.sql | 3 | ||||
-rw-r--r-- | db/schema_0038-time-spent.sql | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/db/downgrade_0038---0037.sql b/db/downgrade_0038---0037.sql new file mode 100644 index 000000000..11a0d11ad --- /dev/null +++ b/db/downgrade_0038---0037.sql @@ -0,0 +1,2 @@ +alter table admin_log + drop column time_spent; diff --git a/db/schema.sql b/db/schema.sql index e87a2aafe..72fccd7f3 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -427,7 +427,8 @@ create table admin_log ( action text not null, whenedited timestamp not null default current_timestamp, user_id int references users(id) null, - reason text not null default '' + reason text not null default '', + time_spent int not null default 0 ); create table moderation_original_data ( diff --git a/db/schema_0038-time-spent.sql b/db/schema_0038-time-spent.sql new file mode 100644 index 000000000..093eb4086 --- /dev/null +++ b/db/schema_0038-time-spent.sql @@ -0,0 +1,2 @@ +alter table admin_log + add column time_spent int not null default 0; |