Skip to content

Commit 7ae91e0

Browse files
Merge remote-tracking branch 'origin/develop' into fb_long_is_the_new_int
2 parents cef5278 + 9053f0d commit 7ae91e0

23 files changed

+91
-47
lines changed

LDK/resources/queries/core/DistinctUsersByMonth.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ from (
2424

2525
SELECT
2626

27-
year(a.date) as year,
28-
month(a.date) as month,
27+
year(a.Created) as year,
28+
month(a.Created) as month,
2929
a.CreatedBy.DisplayName as user
3030

31-
FROM "/".auditlog.audit a
31+
FROM "/".auditlog.UserAuditEvent a
3232

33-
WHERE a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%'
33+
WHERE a.Comment LIKE '%logged in%'
3434

35-
GROUP BY year(a.date), month(a.date), a.CreatedBy.DisplayName
35+
GROUP BY year(a.Created), month(a.Created), a.CreatedBy.DisplayName
3636

3737
) a
3838

LDK/resources/queries/core/SiteUsageByDay.sql

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
*/
1616
SELECT
1717

18-
cast(a.date as date) as date,
18+
cast(a.Created as date) as Date,
1919
CASE
20-
WHEN dayofweek(cast(a.date as date)) = 1 THEN 'Sunday'
21-
WHEN dayofweek(cast(a.date as date)) = 2 THEN 'Monday'
22-
WHEN dayofweek(cast(a.date as date)) = 3 THEN 'Tuesday'
23-
WHEN dayofweek(cast(a.date as date)) = 4 THEN 'Wednesday'
24-
WHEN dayofweek(cast(a.date as date)) = 5 THEN 'Thursday'
25-
WHEN dayofweek(cast(a.date as date)) = 6 THEN 'Friday'
26-
WHEN dayofweek(cast(a.date as date)) = 7 THEN 'Saturday'
20+
WHEN dayofweek(cast(a.Created as date)) = 1 THEN 'Sunday'
21+
WHEN dayofweek(cast(a.Created as date)) = 2 THEN 'Monday'
22+
WHEN dayofweek(cast(a.Created as date)) = 3 THEN 'Tuesday'
23+
WHEN dayofweek(cast(a.Created as date)) = 4 THEN 'Wednesday'
24+
WHEN dayofweek(cast(a.Created as date)) = 5 THEN 'Thursday'
25+
WHEN dayofweek(cast(a.Created as date)) = 6 THEN 'Friday'
26+
WHEN dayofweek(cast(a.Created as date)) = 7 THEN 'Saturday'
2727
END as dayOfWeek,
2828
count(*) AS Logins
2929

30-
FROM "/".auditlog.audit a
30+
FROM "/".auditlog.UserAuditEvent a
3131

32-
WHERE a.EventType = 'UserAuditEvent'
33-
AND a.Comment LIKE '%logged in%'
34-
GROUP BY cast(a.date as date)
32+
WHERE a.Comment LIKE '%logged in%'
33+
GROUP BY cast(a.Created as date)

LDK/resources/queries/core/SiteUsageByHour.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
SELECT
1717

1818

19-
hour(a.date) as Hour,
19+
hour(a.Created) as Hour,
2020
count(*) AS Visits
2121

22-
FROM "/".auditlog.audit a
22+
FROM "/".auditlog.UserAuditEvent a
2323

24-
WHERE a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%'
24+
WHERE a.Comment LIKE '%logged in%'
2525

26-
GROUP BY hour(a.date)
26+
GROUP BY hour(a.Created)

LDK/resources/queries/core/SiteUsageByMonth.sql

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
*/
1616
SELECT
1717

18-
year(a.date) as year,
19-
month(a.date) as month,
20-
cast(cast(year(a.date) as varchar) || '-' || cast(month(a.date) as varchar) || '-01' as DATE) as date,
18+
year(a.Created) as year,
19+
month(a.Created) as month,
20+
cast(cast(year(a.Created) as varchar) || '-' || cast(month(a.Created) as varchar) || '-01' as DATE) as date,
2121
count(*) AS Logins
2222

23-
FROM "/".auditlog.audit a
23+
FROM "/".auditlog.UserAuditEvent a
2424
--FROM audit_pg.auditLog a
2525

26-
WHERE a.EventType = 'UserAuditEvent'
27-
AND a.Comment LIKE '%logged in%'
26+
WHERE a.Comment LIKE '%logged in%'
2827

29-
GROUP BY year(a.date), month(a.date)
28+
GROUP BY year(a.Created), month(a.Created)

LDK/resources/queries/core/SiteUsageByUser.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ PARAMETERS(MinDate TIMESTAMP)
1717

1818
SELECT
1919
a.CreatedBy,
20-
COUNT(a.Date) AS LogInCount
21-
FROM "/".auditlog.audit a
22-
WHERE a.Comment LIKE '%logged in%' AND cast(a.date as date) >= cast(MinDate as date)
20+
COUNT(a.Created) AS LogInCount
21+
FROM "/".auditlog.UserAuditEvent a
22+
WHERE a.Comment LIKE '%logged in%' AND cast(a.Created as date) >= cast(MinDate as date)
2323
GROUP BY a.CreatedBy

LDK/resources/queries/core/SiteUsagePerGroup.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ SELECT
1717

1818
m.UserId,
1919
g.Name AS GroupName,
20-
a.Date,
20+
a.Created AS Date,
2121
a.EventType
2222

2323
FROM core.groups g
2424

2525
LEFT JOIN core.Members m ON (g.UserId = m.GroupId.UserId)
26-
LEFT JOIN "/".auditlog.audit a
27-
ON (a.CreatedBy.UserId = m.UserId.UserId AND a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%')
26+
LEFT JOIN "/".auditlog.UserAuditEvent a
27+
ON (a.CreatedBy.UserId = m.UserId.UserId AND a.Comment LIKE '%logged in%')
2828

2929
WHERE g.Name IS NOT NULL
3030
AND g.Name != ''
31-
AND a.Date IS NOT NULL
31+
AND a.Created IS NOT NULL

LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CREATE TABLE ldk.integers (
1919
CONSTRAINT PK_integers PRIMARY KEY (value)
2020
);
2121

22+
-- @SkipOnEmptySchemasBegin
2223
INSERT INTO ldk.integers (value) VALUES (0);
2324
INSERT INTO ldk.integers (value) VALUES (1);
2425
INSERT INTO ldk.integers (value) VALUES (2);
@@ -120,4 +121,4 @@ INSERT INTO ldk.integers (value) VALUES (97);
120121
INSERT INTO ldk.integers (value) VALUES (98);
121122
INSERT INTO ldk.integers (value) VALUES (99);
122123
INSERT INTO ldk.integers (value) VALUES (100);
123-
124+
-- @SkipOnEmptySchemasEnd

LDK/resources/schemas/dbscripts/postgresql/ldk-12.32-12.33.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- @SkipOnEmptySchemasBegin
12
INSERT INTO ldk.integers (value) VALUES (101);
23
INSERT INTO ldk.integers (value) VALUES (102);
34
INSERT INTO ldk.integers (value) VALUES (103);
@@ -898,3 +899,4 @@ INSERT INTO ldk.integers (value) VALUES (997);
898899
INSERT INTO ldk.integers (value) VALUES (998);
899900
INSERT INTO ldk.integers (value) VALUES (999);
900901
INSERT INTO ldk.integers (value) VALUES (1000);
902+
-- @SkipOnEmptySchemasEnd

LDK/resources/schemas/dbscripts/postgresql/ldk-12.35-12.36.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ CREATE TABLE ldk.daysOfWeek (
55
CONSTRAINT PK_daysOfWeek PRIMARY KEY (idx)
66
);
77

8+
-- @SkipOnEmptySchemasBegin
89
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (1, 'Sunday');
910
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (2, 'Monday');
1011
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (3, 'Tuesday');
1112
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (4, 'Wednesday');
1213
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (5, 'Thursday');
1314
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (6, 'Friday');
14-
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (7, 'Saturday');
15+
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (7, 'Saturday');
16+
-- @SkipOnEmptySchemasEnd

LDK/resources/schemas/dbscripts/postgresql/ldk-12.36-12.37.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CREATE TABLE ldk.months (
66
CONSTRAINT PK_months PRIMARY KEY (rowid)
77
);
88

9+
-- @SkipOnEmptySchemasBegin
910
INSERT into ldk.months (monthName, monthNum) VALUES ('January', 1);
1011
INSERT into ldk.months (monthName, monthNum) VALUES ('February', 2);
1112
INSERT into ldk.months (monthName, monthNum) VALUES ('March', 3);
@@ -18,3 +19,4 @@ INSERT into ldk.months (monthName, monthNum) VALUES ('September', 9);
1819
INSERT into ldk.months (monthName, monthNum) VALUES ('October', 10);
1920
INSERT into ldk.months (monthName, monthNum) VALUES ('November', 11);
2021
INSERT into ldk.months (monthName, monthNum) VALUES ('December', 12);
22+
-- @SkipOnEmptySchemasEnd

0 commit comments

Comments
 (0)