+ 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
This commit is contained in:
shockrah
2021-05-17 15:50:53 -07:00
parent e5e0875037
commit 36dbc8dd1e
5 changed files with 12 additions and 1 deletions

View File

@@ -1,10 +1,13 @@
-- 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` )
);