moving keys into members table

This commit is contained in:
shockrah 2020-07-12 18:50:24 -07:00
parent dfd1d6186c
commit 75f01edac6
3 changed files with 4 additions and 14 deletions

View File

@ -1 +0,0 @@
DROP TABLE `keys`'

View File

@ -1,12 +0,0 @@
-- ID's are given to properly auth'ed users
-- Limit represents a daily limit imposed on users
-- Limits that are null just mean the limit does not exist
CREATE TABLE IF NOT EXISTS `keys`(
`secret` varchar(255) NOT NULL,
`limit` integer,
`uses` integer,
`userid` bigint unsigned NOT NULL,
PRIMARY KEY(`secret`),
FOREIGN KEY (`userid`) REFERENCES members(`id`)
);

View File

@ -1,7 +1,10 @@
-- TODO: add rate limiter in some form
CREATE TABLE IF NOT EXISTS `members`(
`id` bigint UNSIGNED NOT NULL auto_increment,
`secret` varchar(256) NOT NULL,
`name` varchar(255) NOT NULL,
`joindate` bigint UNSIGNED NOT NULL,
`joindate` bigint NOT NULL,
`status` integer NOT NULL,
`permissions` bigint UNSIGNED NOT NULL,
PRIMARY KEY( `id` )
);