mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-03 16:36:38 +00:00
Add siem to migration
This commit is contained in:
@@ -76,9 +76,15 @@ export default async function migration() {
|
||||
`
|
||||
).run();
|
||||
|
||||
db.prepare(`CREATE INDEX 'idx_accessAuditLog_startedAt' ON 'connectionAuditLog' ('startedAt');`).run();
|
||||
db.prepare(`CREATE INDEX 'idx_accessAuditLog_org_startedAt' ON 'connectionAuditLog' ('orgId','startedAt');`).run();
|
||||
db.prepare(`CREATE INDEX 'idx_accessAuditLog_siteResourceId' ON 'connectionAuditLog' ('siteResourceId');`).run();
|
||||
db.prepare(
|
||||
`CREATE INDEX 'idx_accessAuditLog_startedAt' ON 'connectionAuditLog' ('startedAt');`
|
||||
).run();
|
||||
db.prepare(
|
||||
`CREATE INDEX 'idx_accessAuditLog_org_startedAt' ON 'connectionAuditLog' ('orgId','startedAt');`
|
||||
).run();
|
||||
db.prepare(
|
||||
`CREATE INDEX 'idx_accessAuditLog_siteResourceId' ON 'connectionAuditLog' ('siteResourceId');`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`
|
||||
@@ -168,6 +174,42 @@ export default async function migration() {
|
||||
);
|
||||
`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`
|
||||
CREATE TABLE 'eventStreamingCursors' (
|
||||
'cursorId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
'destinationId' integer NOT NULL,
|
||||
'logType' text NOT NULL,
|
||||
'lastSentId' integer DEFAULT 0 NOT NULL,
|
||||
'lastSentAt' integer,
|
||||
FOREIGN KEY ('destinationId') REFERENCES 'eventStreamingDestinations'('destinationId') ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
CREATE UNIQUE INDEX 'idx_eventStreamingCursors_dest_type' ON 'eventStreamingCursors' ('destinationId','logType');--> statement-breakpoint
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
CREATE TABLE 'eventStreamingDestinations' (
|
||||
'destinationId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
'orgId' text NOT NULL,
|
||||
'sendConnectionLogs' integer DEFAULT false NOT NULL,
|
||||
'sendRequestLogs' integer DEFAULT false NOT NULL,
|
||||
'sendActionLogs' integer DEFAULT false NOT NULL,
|
||||
'sendAccessLogs' integer DEFAULT false NOT NULL,
|
||||
'type' text NOT NULL,
|
||||
'config' text NOT NULL,
|
||||
'enabled' integer DEFAULT true NOT NULL,
|
||||
'createdAt' integer NOT NULL,
|
||||
'updatedAt' integer NOT NULL,
|
||||
FOREIGN KEY ('orgId') REFERENCES 'orgs'('orgId') ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`INSERT INTO '__new_userInvites'("inviteId", "orgId", "email", "expiresAt", "token") SELECT "inviteId", "orgId", "email", "expiresAt", "token" FROM 'userInvites';`
|
||||
).run();
|
||||
@@ -191,8 +233,12 @@ export default async function migration() {
|
||||
`ALTER TABLE 'user' ADD 'marketingEmailConsent' integer DEFAULT false;`
|
||||
).run();
|
||||
db.prepare(`ALTER TABLE 'user' ADD 'locale' text;`).run();
|
||||
db.prepare(`ALTER TABLE 'siteProvisioningKeys' ADD COLUMN 'approveNewSites' integer DEFAULT 1 NOT NULL;`).run();
|
||||
db.prepare(`ALTER TABLE 'sites' ADD COLUMN 'status' text DEFAULT 'approved';`).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'siteProvisioningKeys' ADD COLUMN 'approveNewSites' integer DEFAULT 1 NOT NULL;`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE 'sites' ADD COLUMN 'status' text DEFAULT 'approved';`
|
||||
).run();
|
||||
})();
|
||||
|
||||
db.pragma("foreign_keys = ON");
|
||||
|
||||
Reference in New Issue
Block a user