freechat/server/migrations/2020-06-02-055256_keys/up.sql
shockrah cdc88b8365 * fixed formating/comments in users schema
* channels schema now uses a bigint unsigned for pid
this is to keep consistent with notion of id's being usize|u64 in rust
* foreign key constraint added to keys table referencing user rows
2020-07-04 22:52:59 -07:00

12 lines
384 B
SQL

-- 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 users(`id`)
);