freechat/json-api/migrations/2020-07-05-215114_members/up.sql
shockrah 36dbc8dd1e + Badges introduction to database schemas
+ Adding some default empty list values where applicable
neighbors now has a default value of '[]' to enforce the "empty list" constraint on that field
2021-05-17 15:50:53 -07:00

14 lines
531 B
SQL

-- TODO: add rate limiter in some form
-- PERMISSIONS start at 0 and full perms => all F's
-- badges are stored as ad-hoc json for better operability in db-lib
-- mysql_async's json feature is basically 100% undocc'ed and i don't want to deal with it tbh
CREATE TABLE IF NOT EXISTS `members`(
`id` BIGINT UNSIGNED NOT NULL,
`secret` varchar(256) NOT NULL,
`name` varchar(256) NOT NULL,
`status` integer NOT NULL,
`permissions` bigint UNSIGNED NOT NULL,
`badges` VARCHAR(2048) DEFAULT '[]',
PRIMARY KEY( `id` , `secret` )
);