20 lines
547 B
SQL
20 lines
547 B
SQL
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
|
|
);
|