Closed wildtayne closed 6 years ago
Thanks @srrollo for the changes. I totally agree the doc on removing users is extremely helpful.
I have the following observations in addFrequentViewsCore.sql
(some of these I find as I review the fie):
StudentTable
: needs ORDER BY UserName, SchemaName, TableName
getUserDDLActivity
: needs ORDER BY UserName, StatementStartedAt DESC
getUserConnectionActivity
: needs ORDER BY UserName, AcceptedAt DESC
getUserActivity
: needs ORDER BY UserName, ActivityAt DESC
(see below)
StatementStartedAt
as ActivityAt
in the first query so it is easy to relate the columns in ORDER BY
to the final outputRelated, I also suggest adding ORDER BY UserName
to view User
in addClassDBRolesViewsCore.sql
. This change will automatically impose ordering on the result of some functions in addFrequentViewsCore.sql
.
I have not had a chance to look at the test scripts, but I notice a COMMIT
has changed to ROLLBACK
. This is the correct approach. However, in a test script that uses ROLLBACK
, it is not necessary to drop/delete objects unless drop/delete is part of the test.
I just created a new issue #197 about using ROLLBACK
instead of COMMIT
in test scripts, but we don't need to address that issue in M2.
Thanks for the review @smurthys. I've made the suggested changes to ordering.
Good point about not dropping objects in tests when not using ROLLBACK
. In this case, testAddConnectionActivityLogging.psql
can't use ROLLBACK
, because the test spans multiple transactions due to changing connections.
This is a collection of small fixes/improvements to the logging tests scripts and user views. I intended for this to be two separate PRs, but I accidentally merged all the changes into one commit.
ClassDB.StudentActivitySummaryAnon
view now calls the correct underlying functionClassDB.getUserAcitivity()
orders activity records by username, so all views/functions that return individual activity records are now ordered by username.With these changes, all tests pass a new ClassDB instance setup using the new quick-start guide 🎉