Add a DBML schema for the sqloper module and update the tables.

This commit is contained in:
Sadie Powell 2024-07-01 12:57:04 +01:00
parent de1ede1ebc
commit 4718cec54a
4 changed files with 141 additions and 34 deletions

View File

@ -1,12 +1,31 @@
CREATE TABLE ircd_opers (
id bigint(20) NOT NULL auto_increment,
name text NOT NULL,
password text NOT NULL,
hash text,
host text NOT NULL,
type text NOT NULL,
fingerprint text,
autologin tinyint(1) NOT NULL DEFAULT 0,
active tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `ircd_opers` (
`active` bool NOT NULL DEFAULT true,
`name` text NOT NULL,
`password` text NOT NULL,
`host` text NOT NULL,
`type` text NOT NULL,
`autologin` ENUM ('strict', 'relaxed', 'never'),
`class` text,
`hash` text,
`maxchans` bigint,
`nopassword` bool,
`vhost` text,
`commands` text,
`privs` text,
`chanmodes` text,
`usermodes` text,
`snomasks` text,
`account` text,
`autojoin` text,
`automotd` bool,
`fingerprint` text,
`level` bigint,
`modes` text,
`motd` bool,
`override` text,
`sslonly` bool,
`swhois` text
);

View File

@ -1,13 +1,37 @@
CREATE TABLE ircd_opers (
"id" serial NOT NULL,
CREATE TYPE "autologin" AS ENUM (
'strict',
'relaxed',
'never'
);
CREATE TABLE "ircd_opers" (
"active" bool NOT NULL DEFAULT true,
"name" text NOT NULL,
"password" text NOT NULL,
"hash" text,
"host" text NOT NULL,
"type" text NOT NULL,
"autologin" autologin,
"class" text,
"hash" text,
"maxchans" bigint,
"nopassword" bool,
"vhost" text,
"commands" text,
"privs" text,
"chanmodes" text,
"usermodes" text,
"snomasks" text,
"account" text,
"autojoin" text,
"automotd" bool,
"fingerprint" text,
"autologin" smallint NOT NULL DEFAULT 0,
"active" smallint NOT NULL DEFAULT 1
"level" bigint,
"modes" text,
"motd" bool,
"override" text,
"sslonly" bool,
"swhois" text
);
ALTER TABLE ONLY ircd_opers
ADD CONSTRAINT ircd_opers_pkey PRIMARY KEY (id);

View File

@ -0,0 +1,43 @@
Enum autologin {
strict
relaxed
never
}
Table ircd_opers {
// internal to sqloper
active bool [default: true, not null]
// core oper config (required)
name text [not null]
password text [not null]
host text [not null]
type text [not null]
// core oper config (optional)
autologin autologin [null]
class text [null]
hash text [null]
maxchans bigint [null]
nopassword bool [null]
vhost text [null]
// core type config
commands text [null]
privs text [null]
chanmodes text [null]
usermodes text [null]
snomasks text [null]
// module config
account text [null] // account
autojoin text [null] // operjoin
automotd bool [null] // opermotd
fingerprint text [null] // sslinfo
level bigint [null] // operlevels
modes text [null] // opermodes
motd bool [null] // opermotd
override text [null] // override
sslonly bool [null] // sslinfo
swhois text [null] // swhois
}

View File

@ -1,10 +1,31 @@
CREATE TABLE ircd_opers (
id integer primary key,
name text NOT NULL,
password text NOT NULL,
hash text,
host text NOT NULL,
type text NOT NULL,
fingerprint text,
autologin integer NOT NULL DEFAULT 0,
active integer NOT NULL DEFAULT 1);
CREATE TABLE IF NOT EXISTS "ircd_opers" (
"active" bool NOT NULL DEFAULT true,
"name" text NOT NULL,
"password" text NOT NULL,
"host" text NOT NULL,
"type" text NOT NULL,
"autologin" CHECK ("autologin" IN ('strict', 'relaxed', 'never')),
"class" text,
"hash" text,
"maxchans" bigint,
"nopassword" bool,
"vhost" text,
"commands" text,
"privs" text,
"chanmodes" text,
"usermodes" text,
"snomasks" text,
"account" text,
"autojoin" text,
"automotd" bool,
"fingerprint" text,
"level" bigint,
"modes" text,
"motd" bool,
"override" text,
"sslonly" bool,
"swhois" text
);