diff --git a/app/components/incident/header/index.tsx b/app/components/incident/header/index.tsx
index a61633d8..4156574f 100644
--- a/app/components/incident/header/index.tsx
+++ b/app/components/incident/header/index.tsx
@@ -109,7 +109,7 @@ const HomeIncidentHeader = ({
) : null}
- {isEditor ? (
+ {isEditor && incident ? (
<>
diff --git a/app/components/monitor/status.tsx b/app/components/monitor/status.tsx
index dbc62b45..9edf73aa 100644
--- a/app/components/monitor/status.tsx
+++ b/app/components/monitor/status.tsx
@@ -45,21 +45,25 @@ const MonitorStatus = ({
{monitor.uptimePercentage || 0}%
-
-
- {t('home.monitor.headers.cert_expiry')}
-
-
- ({t('home.monitor.headers.days_left')})
+ {monitor.type === 'ping' ||
+ monitor.type === 'push' ||
+ monitor.type === 'docker' ? null : (
+
+
+ {t('home.monitor.headers.cert_expiry')}
+
+
+ ({t('home.monitor.headers.days_left')})
+
+
+ {monitor.url?.startsWith('http://')
+ ? t('common.invalid')
+ : monitor.cert?.isValid
+ ? `${monitor.cert.daysRemaining}`
+ : t('common.expired')}
+
-
- {monitor.url?.startsWith('http://')
- ? t('common.invalid')
- : monitor.cert?.isValid
- ? `${monitor.cert.daysRemaining}`
- : t('common.expired')}
-
-
+ )}
);
};
diff --git a/app/components/navigation/info/index.scss b/app/components/navigation/info/index.scss
index 5dc54865..951782a6 100644
--- a/app/components/navigation/info/index.scss
+++ b/app/components/navigation/info/index.scss
@@ -28,4 +28,8 @@
display: flex;
align-items: center;
}
+
+ > div:last-child {
+ word-break: break-all;
+ }
}
diff --git a/app/components/navigation/info/monitor.tsx b/app/components/navigation/info/monitor.tsx
index ddc76bd6..9cdb9c51 100644
--- a/app/components/navigation/info/monitor.tsx
+++ b/app/components/navigation/info/monitor.tsx
@@ -144,7 +144,7 @@ const NavigationMonitorInfo = ({ monitor }: { monitor: MonitorProps }) => {
{t('home.info.url')}
- {monitor.type === 'http'
+ {monitor.type !== 'tcp'
? monitor.url
: `${monitor.url}:${monitor.port}`}
diff --git a/app/components/status/configure/layout/customHTML.tsx b/app/components/status/configure/layout/customHTML.tsx
index 424d71e2..a0aa136c 100644
--- a/app/components/status/configure/layout/customHTML.tsx
+++ b/app/components/status/configure/layout/customHTML.tsx
@@ -9,7 +9,7 @@ import { FaTrashCan } from '../../../icons';
import useStatusPageContext from '../../../../context/status-page';
const StatusConfigureLayoutCustomHTML = ({ componentId }) => {
- const { getComponent, setComponentValue, removeComponent } =
+ const { getComponent, setComponentValue, removeComponent, layoutItems } =
useStatusPageContext();
const { isMinimized, data } = useMemo(
diff --git a/app/styles/pages/incidents.scss b/app/styles/pages/incidents.scss
index a89bce2c..0d77b4c0 100644
--- a/app/styles/pages/incidents.scss
+++ b/app/styles/pages/incidents.scss
@@ -17,6 +17,7 @@
display: flex;
gap: pxToRem(10);
padding-bottom: pxToRem(10);
+ margin: pxToRem(10) 0;
}
.icm-title {
@@ -33,6 +34,9 @@
display: flex;
flex-direction: column;
gap: pxToRem(5);
+ max-height: pxToRem(350);
+ overflow-y: auto;
+ margin: pxToRem(10) 0;
}
.icml-item {
diff --git a/app/types/context/global.d.ts b/app/types/context/global.d.ts
index 315d830c..9e5e65e6 100644
--- a/app/types/context/global.d.ts
+++ b/app/types/context/global.d.ts
@@ -11,7 +11,7 @@ export interface ContextMonitorProps {
body: Record
;
valid_status_codes: string[];
email: string;
- type: 'http' | 'json' | 'ping' | 'tcp';
+ type: 'docker' | 'http' | 'json' | 'ping' | 'push' | 'tcp';
notificationId: string;
notificationType: string;
uptimePercentage: number;
diff --git a/app/types/monitor.d.ts b/app/types/monitor.d.ts
index d1aaf1eb..96a9c653 100644
--- a/app/types/monitor.d.ts
+++ b/app/types/monitor.d.ts
@@ -24,6 +24,7 @@ export interface MonitorProps {
createdAt: string;
cert: CertificateProps;
heartbeats: HeartbeatProps[];
+ statusChanged: HeartbeatProps[];
icon: { id: string; name: string; url: string };
[key: string]: any;
}
diff --git a/package-lock.json b/package-lock.json
index c5a8dfe8..c8535e81 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "lunalytics",
- "version": "0.10.20",
+ "version": "0.10.21",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "lunalytics",
- "version": "0.10.20",
+ "version": "0.10.21",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@dnd-kit/core": "6.3.1",
diff --git a/package.json b/package.json
index f2ae6b0d..be7c2c40 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lunalytics",
- "version": "0.10.20",
+ "version": "0.10.21",
"description": "Open source Node.js server/website monitoring tool",
"private": true,
"author": "KSJaay ",
diff --git a/scripts/migrations/0-10-21.js b/scripts/migrations/0-10-21.js
new file mode 100644
index 00000000..df1fa199
--- /dev/null
+++ b/scripts/migrations/0-10-21.js
@@ -0,0 +1,46 @@
+// import local files
+import SQLite from '../../server/database/sqlite/setup.js';
+import logger from '../../server/utils/logger.js';
+
+const infomation = {
+ title: 'Dropdown redundant indexes',
+ description:
+ 'Drops various redundant indexes from the database and adds improved ones.',
+ version: '0.10.21',
+};
+
+const migrate = async () => {
+ const client = await SQLite.connect();
+
+ await client.raw(`DROP INDEX IF EXISTS heartbeat_monitorid_index;`);
+ await client.raw(`DROP INDEX IF EXISTS hourly_heartbeat_monitorid_index;`);
+
+ client.raw(
+ `CREATE INDEX IF NOT EXISTS heartbeat_monitorid_date_index ON heartbeat (monitorId, date DESC);`
+ );
+
+ client.raw(
+ `CREATE INDEX IF NOT EXISTS hourly_heartbeat_monitorid_date_index ON hourly_heartbeat (monitorId, date DESC);`
+ );
+
+ const redundantIndexes = [
+ 'api_token_token_index',
+ 'heartbeat_monitorid_index',
+ 'hourly_heartbeat_monitorid_index',
+ 'incident_incidentid_index',
+ 'invite_token_index',
+ 'status_page_statusid_index',
+ 'status_page_statusurl_index',
+ 'user_session_sessionid_index',
+ 'user_email_index',
+ ];
+
+ for (const indexName of redundantIndexes) {
+ await client.raw(`DROP INDEX IF EXISTS ${indexName};`);
+ }
+
+ logger.info('Migrations', { message: '0.10.21 has been applied' });
+ return;
+};
+
+export { infomation, migrate };
diff --git a/scripts/migrations/index.js b/scripts/migrations/index.js
index 65b174cf..a3be2349 100644
--- a/scripts/migrations/index.js
+++ b/scripts/migrations/index.js
@@ -13,6 +13,7 @@ import { migrate as migrateMonitorJson } from './0-9-7.js';
import { migrate as migrateUiOverhaul } from './0-10-0.js';
import { migrate as migrateMonitorParent } from './0-10-13.js';
import { migrate as migrateUserSettings } from './0-10-16.js';
+import { migrate as migrateIndexes } from './0-10-21.js';
const migrationList = {
'0.4.0': migrateTcpUpdate,
@@ -29,6 +30,7 @@ const migrationList = {
'0.10.0': migrateUiOverhaul,
'0.10.13': migrateMonitorParent,
'0.10.16': migrateUserSettings,
+ '0.10.21': migrateIndexes,
};
export default migrationList;
diff --git a/server/class/monitor/docker.js b/server/class/monitor/docker.js
index 4ae2731e..fb8fd129 100644
--- a/server/class/monitor/docker.js
+++ b/server/class/monitor/docker.js
@@ -20,6 +20,7 @@ const clean = ({ heartbeats = [], ...monitor }, includeHeartbeats = true) => ({
ignoreTls: monitor.ignoreTls == '1',
createdAt: monitor.createdAt,
heartbeats: includeHeartbeats ? heartbeats : undefined,
+ statusChanged: includeHeartbeats ? monitor.statusChanged : undefined,
icon: parseJsonOrArray(monitor.icon),
});
diff --git a/server/class/monitor/http.js b/server/class/monitor/http.js
index 0b365026..da545f11 100644
--- a/server/class/monitor/http.js
+++ b/server/class/monitor/http.js
@@ -30,6 +30,7 @@ const clean = (
createdAt: monitor.createdAt,
cert: includeCert ? cleanCertificate(cert) : undefined,
heartbeats: includeHeartbeats ? heartbeats : undefined,
+ statusChanged: includeHeartbeats ? monitor.statusChanged : undefined,
icon: parseJsonOrArray(monitor.icon),
});
diff --git a/server/class/monitor/json.js b/server/class/monitor/json.js
index 4cb2ab21..a37516f2 100644
--- a/server/class/monitor/json.js
+++ b/server/class/monitor/json.js
@@ -30,6 +30,7 @@ export const clean = (
createdAt: monitor.createdAt,
cert: includeCert ? cleanCertificate(cert) : undefined,
heartbeats: includeHeartbeats ? heartbeats : undefined,
+ statusChanged: includeHeartbeats ? monitor.statusChanged : undefined,
icon: parseJsonOrArray(monitor.icon),
});
diff --git a/server/class/monitor/ping.js b/server/class/monitor/ping.js
index ec36959b..d3519356 100644
--- a/server/class/monitor/ping.js
+++ b/server/class/monitor/ping.js
@@ -25,6 +25,7 @@ export const clean = (
paused: monitor.paused == '1',
createdAt: monitor.createdAt,
heartbeats: includeHeartbeats ? heartbeats : undefined,
+ statusChanged: includeHeartbeats ? monitor.statusChanged : undefined,
icon: parseJsonOrArray(monitor.icon),
});
diff --git a/server/class/monitor/tcp.js b/server/class/monitor/tcp.js
index 6f593122..9c18dbcb 100644
--- a/server/class/monitor/tcp.js
+++ b/server/class/monitor/tcp.js
@@ -20,6 +20,7 @@ const clean = ({ heartbeats = [], ...monitor }, includeHeartbeats = true) => ({
paused: monitor.paused == '1',
createdAt: monitor.createdAt,
heartbeats: includeHeartbeats ? heartbeats : undefined,
+ statusChanged: includeHeartbeats ? monitor.statusChanged : undefined,
icon: parseJsonOrArray(monitor.icon),
});
diff --git a/server/database/queries/heartbeat.js b/server/database/queries/heartbeat.js
index 6db6f7aa..7ed100b1 100644
--- a/server/database/queries/heartbeat.js
+++ b/server/database/queries/heartbeat.js
@@ -10,6 +10,27 @@ export const fetchHeartbeats = async (monitorId, limit = 168) => {
return heartbeats;
};
+export const fetchStatusChangeHeartbeats = async (monitorId, limit = 20) => {
+ const rawQuery = `
+ SELECT id, status, latency, date, isDown, message
+ FROM (
+ SELECT *, LAG(isDown) OVER (PARTITION BY monitorId ORDER BY date DESC) AS prevIsDown
+ FROM (
+ SELECT * FROM heartbeat
+ WHERE monitorId = ?
+ ORDER BY date DESC
+ LIMIT 1000
+ )
+ )
+ WHERE isDown != prevIsDown OR prevIsDown IS NULL
+ ORDER BY date DESC
+ LIMIT ?;
+ `;
+ const statusChanges = await SQLite.client.raw(rawQuery, [monitorId, limit]);
+
+ return statusChanges;
+};
+
export const isMonitorDown = async (monitorId, limit = 1) => {
const newLimit = limit || 1;
diff --git a/server/database/sqlite/setup.js b/server/database/sqlite/setup.js
index 69b9734b..966eaa7a 100644
--- a/server/database/sqlite/setup.js
+++ b/server/database/sqlite/setup.js
@@ -84,6 +84,9 @@ export class SQLite {
// Need to enable this for foreign key to work
await this.client.raw('PRAGMA foreign_keys = ON');
+ await this.client.raw('PRAGMA journal_mode = WAL'); // Better concurrency
+ await this.client.raw('PRAGMA cache_size = -12000'); // 12 MB cache
+
logger.info('SQLite', {
message: 'Connected to SQLite database',
});
diff --git a/server/database/sqlite/tables/api_token.js b/server/database/sqlite/tables/api_token.js
index b93905fc..3adf090a 100644
--- a/server/database/sqlite/tables/api_token.js
+++ b/server/database/sqlite/tables/api_token.js
@@ -9,7 +9,6 @@ export const apiTokenTable = async (client) => {
table.string('email').notNullable();
table.datetime('createdAt');
- table.index('token');
table.index('email');
});
}
diff --git a/server/database/sqlite/tables/heartbeat.js b/server/database/sqlite/tables/heartbeat.js
index ace28f72..2daba21f 100644
--- a/server/database/sqlite/tables/heartbeat.js
+++ b/server/database/sqlite/tables/heartbeat.js
@@ -17,9 +17,10 @@ export const heartbeatTable = async (client) => {
table.datetime('date').notNullable();
table.boolean('isDown').defaultTo(false);
table.text('message').notNullable();
-
- table.index('monitorId');
- table.index(['monitorId', 'date']);
});
+
+ client.raw(
+ `CREATE INDEX IF NOT EXISTS heartbeat_monitorid_date_index ON heartbeat (monitorId, date DESC);`
+ );
}
};
diff --git a/server/database/sqlite/tables/hourly_heartbeat.js b/server/database/sqlite/tables/hourly_heartbeat.js
index 94caa15c..156a7507 100644
--- a/server/database/sqlite/tables/hourly_heartbeat.js
+++ b/server/database/sqlite/tables/hourly_heartbeat.js
@@ -17,9 +17,10 @@ export const hourlyHeartbeatTable = async (client) => {
table.integer('status').notNullable();
table.integer('latency').notNullable();
table.datetime('date').notNullable();
-
- table.index('monitorId');
- table.index(['monitorId', 'date']);
});
+
+ client.raw(
+ `CREATE INDEX IF NOT EXISTS hourly_heartbeat_monitorid_date_index ON hourly_heartbeat (monitorId, date DESC);`
+ );
}
};
diff --git a/server/database/sqlite/tables/incident.js b/server/database/sqlite/tables/incident.js
index 0de1110b..9cdb6324 100644
--- a/server/database/sqlite/tables/incident.js
+++ b/server/database/sqlite/tables/incident.js
@@ -14,7 +14,6 @@ export const incidentTable = async (client) => {
table.datetime('completedAt');
table.boolean('isClosed').defaultTo(false);
- table.index('incidentId');
table.index('createdAt');
table.index('completedAt');
table.index('isClosed');
diff --git a/server/database/sqlite/tables/invite.js b/server/database/sqlite/tables/invite.js
index 6bce4ff2..9b6f345c 100644
--- a/server/database/sqlite/tables/invite.js
+++ b/server/database/sqlite/tables/invite.js
@@ -13,7 +13,6 @@ export const inviteTable = async (client) => {
table.integer('uses').defaultTo(0);
table.index('email');
- table.index('token');
});
}
};
diff --git a/server/database/sqlite/tables/monitor.js b/server/database/sqlite/tables/monitor.js
index 5b42fad2..fe6c0ada 100644
--- a/server/database/sqlite/tables/monitor.js
+++ b/server/database/sqlite/tables/monitor.js
@@ -4,7 +4,7 @@ export const monitorTable = async (client) => {
if (!monitorExists) {
await client.schema.createTable('monitor', (table) => {
table.increments('id');
- table.string('monitorId').notNullable().primary();
+ table.string('monitorId').notNullable().primary().unique();
table.string('parentId').defaultTo(null);
table.string('name').notNullable();
table.string('url').notNullable();
@@ -30,8 +30,6 @@ export const monitorTable = async (client) => {
name: 'Lunalytics',
url: 'https://cdn.jsdelivr.net/gh/selfhst/icons/svg/lunalytics.svg',
});
-
- table.index('monitorId');
});
}
};
diff --git a/server/database/sqlite/tables/notifications.js b/server/database/sqlite/tables/notifications.js
index 2a6f3752..2494f447 100644
--- a/server/database/sqlite/tables/notifications.js
+++ b/server/database/sqlite/tables/notifications.js
@@ -3,7 +3,7 @@ export const notificationsTable = async (client) => {
if (!notificationExists) {
await client.schema.createTable('notifications', (table) => {
- table.string('id').notNullable().primary();
+ table.string('id').notNullable().primary().unique();
table.string('platform').notNullable();
table.string('messageType').notNullable();
table.text('token').notNullable();
@@ -13,8 +13,6 @@ export const notificationsTable = async (client) => {
table.string('friendlyName');
table.text('data');
table.datetime('createdAt');
-
- table.index('id');
});
}
};
diff --git a/server/database/sqlite/tables/provider.js b/server/database/sqlite/tables/provider.js
index 897bdc04..c5b4e438 100644
--- a/server/database/sqlite/tables/provider.js
+++ b/server/database/sqlite/tables/provider.js
@@ -13,7 +13,7 @@ export const providersTable = async (client) => {
table.boolean('enabled').defaultTo(true);
table.json('data').defaultTo({});
- table.index(['provider']);
+ table.index('provider');
});
}
};
diff --git a/server/database/sqlite/tables/status_page.js b/server/database/sqlite/tables/status_page.js
index 7789ba94..1dc6708e 100644
--- a/server/database/sqlite/tables/status_page.js
+++ b/server/database/sqlite/tables/status_page.js
@@ -10,9 +10,6 @@ export const statusPageTable = async (client) => {
table.json('layout').notNullable();
table.string('email').notNullable();
table.datetime('createdAt');
-
- table.index('statusId');
- table.index('statusUrl');
});
}
};
diff --git a/server/database/sqlite/tables/user.js b/server/database/sqlite/tables/user.js
index 5e0c4196..70aa2711 100644
--- a/server/database/sqlite/tables/user.js
+++ b/server/database/sqlite/tables/user.js
@@ -16,7 +16,6 @@ export const userTable = async (client) => {
table.datetime('createdAt');
table.jsonb('settings').defaultTo(JSON.stringify({}));
- table.index('email');
table.index('isVerified');
});
}
diff --git a/server/database/sqlite/tables/user_session.js b/server/database/sqlite/tables/user_session.js
index d0ede421..6e7f1172 100644
--- a/server/database/sqlite/tables/user_session.js
+++ b/server/database/sqlite/tables/user_session.js
@@ -10,7 +10,6 @@ export const userSessionTable = async (client) => {
table.jsonb('data');
table.datetime('createdAt');
- table.index('sessionId');
table.index('email');
});
}
diff --git a/server/middleware/auth/setup.js b/server/middleware/auth/setup.js
index e0aaa939..832514a2 100644
--- a/server/middleware/auth/setup.js
+++ b/server/middleware/auth/setup.js
@@ -166,6 +166,7 @@ const setupMiddleware = async (request, response) => {
avatar: null,
permission: oldPermsToFlags[1],
isVerified: true,
+ isOwner: true,
createdAt: new Date().toISOString(),
};
diff --git a/server/middleware/user/monitors.js b/server/middleware/user/monitors.js
index df215f5b..78244e16 100644
--- a/server/middleware/user/monitors.js
+++ b/server/middleware/user/monitors.js
@@ -14,7 +14,13 @@ const userMonitorsMiddleware = async (request, response) => {
for (const monitor of monitors) {
const heartbeats = await fetchHeartbeats(monitor.monitorId, 12);
+ // const statusChanged = await fetchStatusChangeHeartbeats(
+ // monitor.monitorId,
+ // 20
+ // );
+
monitor.heartbeats = heartbeats;
+ // monitor.statusChanged = statusChanged;
monitor.cert = { isValid: false };
diff --git a/shared/validators/user.js b/shared/validators/user.js
index 538e4e61..c75e919c 100644
--- a/shared/validators/user.js
+++ b/shared/validators/user.js
@@ -23,7 +23,7 @@ const isImageUrl = (url) => {
return false;
}
- return url.match(/^https?:\/\/.+\.(jpg|jpeg|png|gif)$/gim);
+ return url.match(/^https?:\/\//gim);
};
const isAvatar = (avatar) => {
diff --git a/test/server/database/schema/api_token.test.js b/test/server/database/schema/api_token.test.js
index fedc08d6..52a22838 100644
--- a/test/server/database/schema/api_token.test.js
+++ b/test/server/database/schema/api_token.test.js
@@ -57,7 +57,6 @@ describe('apiTokenTable()', () => {
expect(stringMock).toHaveBeenCalledWith('permission');
expect(stringMock).toHaveBeenCalledWith('email');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
- expect(indexMock).toHaveBeenCalledWith('token');
expect(indexMock).toHaveBeenCalledWith('email');
});
});
diff --git a/test/server/database/schema/heartbeat.test.js b/test/server/database/schema/heartbeat.test.js
index c931e8c6..55d99362 100644
--- a/test/server/database/schema/heartbeat.test.js
+++ b/test/server/database/schema/heartbeat.test.js
@@ -9,7 +9,7 @@ describe('heartbeatTable()', () => {
hasTable: vi.fn(),
createTable: vi.fn((tableName, callback) => {}),
};
- mockClient = { schema: mockSchema };
+ mockClient = { schema: mockSchema, raw: vi.fn() };
});
it('should NOT create the table if it already exists', async () => {
@@ -28,6 +28,9 @@ describe('heartbeatTable()', () => {
expect(createTableCall[0]).toBe('heartbeat');
const callback = createTableCall[1];
expect(typeof callback).toBe('function');
+ expect(mockClient.raw).toHaveBeenCalledWith(
+ 'CREATE INDEX IF NOT EXISTS heartbeat_monitorid_date_index ON heartbeat (monitorId, date DESC);'
+ );
});
it('should define all columns and constraints correctly', async () => {
@@ -67,7 +70,5 @@ describe('heartbeatTable()', () => {
expect(datetimeMock).toHaveBeenCalledWith('date');
expect(booleanMock).toHaveBeenCalledWith('isDown');
expect(textMock).toHaveBeenCalledWith('message');
- expect(indexMock).toHaveBeenCalledWith('monitorId');
- expect(indexMock).toHaveBeenCalledWith(['monitorId', 'date']);
});
});
diff --git a/test/server/database/schema/hourly_heartbeat.test.js b/test/server/database/schema/hourly_heartbeat.test.js
index 0da4d474..aa5335cb 100644
--- a/test/server/database/schema/hourly_heartbeat.test.js
+++ b/test/server/database/schema/hourly_heartbeat.test.js
@@ -9,7 +9,7 @@ describe('hourlyHeartbeatTable()', () => {
hasTable: vi.fn(),
createTable: vi.fn((tableName, callback) => {}),
};
- mockClient = { schema: mockSchema };
+ mockClient = { schema: mockSchema, raw: vi.fn() };
});
it('should NOT create the table if it already exists', async () => {
@@ -61,7 +61,5 @@ describe('hourlyHeartbeatTable()', () => {
expect(integerMock).toHaveBeenCalledWith('status');
expect(integerMock).toHaveBeenCalledWith('latency');
expect(datetimeMock).toHaveBeenCalledWith('date');
- expect(indexMock).toHaveBeenCalledWith('monitorId');
- expect(indexMock).toHaveBeenCalledWith(['monitorId', 'date']);
});
});
diff --git a/test/server/database/schema/incident.test.js b/test/server/database/schema/incident.test.js
index dff283b1..6d7727e0 100644
--- a/test/server/database/schema/incident.test.js
+++ b/test/server/database/schema/incident.test.js
@@ -66,7 +66,6 @@ describe('incidentTable()', () => {
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
expect(datetimeMock).toHaveBeenCalledWith('completedAt');
expect(booleanMock).toHaveBeenCalledWith('isClosed');
- expect(indexMock).toHaveBeenCalledWith('incidentId');
expect(indexMock).toHaveBeenCalledWith('createdAt');
expect(indexMock).toHaveBeenCalledWith('completedAt');
expect(indexMock).toHaveBeenCalledWith('isClosed');
diff --git a/test/server/database/schema/invite.test.js b/test/server/database/schema/invite.test.js
index dbe9ff95..50a8d6f5 100644
--- a/test/server/database/schema/invite.test.js
+++ b/test/server/database/schema/invite.test.js
@@ -63,6 +63,5 @@ describe('inviteTable()', () => {
expect(integerMock).toHaveBeenCalledWith('limit');
expect(integerMock).toHaveBeenCalledWith('uses');
expect(indexMock).toHaveBeenCalledWith('email');
- expect(indexMock).toHaveBeenCalledWith('token');
});
});
diff --git a/test/server/database/schema/monitor.test.js b/test/server/database/schema/monitor.test.js
index 10312b16..93b93635 100644
--- a/test/server/database/schema/monitor.test.js
+++ b/test/server/database/schema/monitor.test.js
@@ -83,6 +83,5 @@ describe('monitorTable()', () => {
expect(jsonMock).toHaveBeenCalledWith('json_query');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
expect(jsonMock).toHaveBeenCalledWith('icon');
- expect(indexMock).toHaveBeenCalledWith('monitorId');
});
});
diff --git a/test/server/database/schema/notifications.test.js b/test/server/database/schema/notifications.test.js
index de13e1c2..329666c0 100644
--- a/test/server/database/schema/notifications.test.js
+++ b/test/server/database/schema/notifications.test.js
@@ -64,6 +64,5 @@ describe('notificationsTable()', () => {
expect(stringMock).toHaveBeenCalledWith('friendlyName');
expect(textMock).toHaveBeenCalledWith('data');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
- expect(indexMock).toHaveBeenCalledWith('id');
});
});
diff --git a/test/server/database/schema/provider.test.js b/test/server/database/schema/provider.test.js
index 5e5a5f44..5baea623 100644
--- a/test/server/database/schema/provider.test.js
+++ b/test/server/database/schema/provider.test.js
@@ -61,6 +61,6 @@ describe('providersTable()', () => {
expect(stringMock).toHaveBeenCalledWith('clientSecret');
expect(booleanMock).toHaveBeenCalledWith('enabled');
expect(jsonMock).toHaveBeenCalledWith('data');
- expect(indexMock).toHaveBeenCalledWith(['provider']);
+ expect(indexMock).toHaveBeenCalledWith('provider');
});
});
diff --git a/test/server/database/schema/status_page.test.js b/test/server/database/schema/status_page.test.js
index 626aaef7..7b4060e2 100644
--- a/test/server/database/schema/status_page.test.js
+++ b/test/server/database/schema/status_page.test.js
@@ -61,7 +61,5 @@ describe('statusPageTable()', () => {
expect(jsonMock).toHaveBeenCalledWith('layout');
expect(stringMock).toHaveBeenCalledWith('email');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
- expect(indexMock).toHaveBeenCalledWith('statusId');
- expect(indexMock).toHaveBeenCalledWith('statusUrl');
});
});
diff --git a/test/server/database/schema/user.test.js b/test/server/database/schema/user.test.js
index 961899cd..701ce8b5 100644
--- a/test/server/database/schema/user.test.js
+++ b/test/server/database/schema/user.test.js
@@ -68,7 +68,6 @@ describe('userTable()', () => {
expect(integerMock).toHaveBeenCalledWith('permission');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
expect(jsonbMock).toHaveBeenCalledWith('settings');
- expect(indexMock).toHaveBeenCalledWith('email');
expect(indexMock).toHaveBeenCalledWith('isVerified');
});
});
diff --git a/test/server/database/schema/user_session.test.js b/test/server/database/schema/user_session.test.js
index 2229e6db..eb67080d 100644
--- a/test/server/database/schema/user_session.test.js
+++ b/test/server/database/schema/user_session.test.js
@@ -62,7 +62,6 @@ describe('userSessionTable()', () => {
expect(jsonbMock).toHaveBeenCalledWith('device');
expect(jsonbMock).toHaveBeenCalledWith('data');
expect(datetimeMock).toHaveBeenCalledWith('createdAt');
- expect(indexMock).toHaveBeenCalledWith('sessionId');
expect(indexMock).toHaveBeenCalledWith('email');
});
});