-- A system administrator role, and the first thing in this server that one user -- can do and another cannot. -- -- Until now every authenticated caller could create and delete users, set -- anybody's password and mint API keys for anybody — auth.go said so in a -- comment. That was defensible with one operator and a hand-made account; it is -- not once people sign themselves up (see #7). -- -- EVERY EXISTING USER BECOMES AN ADMIN. They already hold these powers, so -- this migration changes nobody's access: it names what is already true, and -- leaves demotion as a deliberate act somebody performs afterwards. The -- alternative — promoting only user 1 — would silently strip the others, and -- could leave an install whose only admin is an account nobody has a password -- for. -- -- New users are not admins: the column defaults to false, and the only ways to -- become one are this backfill, the bootstrap endpoint, or an existing admin -- granting it. ALTER TABLE users ADD COLUMN is_admin BOOLEAN NOT NULL DEFAULT false; UPDATE users SET is_admin = true; -- The queue's assignment dropdown and the on-call schedule read every user, and -- the admin screens in #5 will filter on this. CREATE INDEX users_is_admin_idx ON users(is_admin) WHERE is_admin;