Add network protection and administrator account support
This commit is contained in:
19
apps/server/drizzle/0014_network_protection.sql
Normal file
19
apps/server/drizzle/0014_network_protection.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE `automatic_blocks` (
|
||||
`ip` text PRIMARY KEY NOT NULL,
|
||||
`countryCode` text,
|
||||
`reason` text NOT NULL,
|
||||
`createdAt` integer NOT NULL,
|
||||
`expiresAt` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `automatic_block_expiry` ON `automatic_blocks` (`expiresAt`);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `user_activity` (
|
||||
`userId` text PRIMARY KEY NOT NULL,
|
||||
`lastSeenAt` integer NOT NULL,
|
||||
`ip` text,
|
||||
`countryCode` text,
|
||||
`region` text,
|
||||
`city` text,
|
||||
FOREIGN KEY (`userId`) REFERENCES `users`(`id`) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user