Closed alex-savin closed 1 year ago
The table names and column names of the two tables can be customized and then configured in the configuration file. See cmd/config/auth-postgresql.yml.
schema reference:
CREATE TABLE mqtt_user ( id serial PRIMARY KEY, username varchar(32) NOT NULL UNIQUE, password varchar(32) NOT NULL, allow smallint DEFAULT 1 NOT NULL, created timestamp with time zone DEFAULT NOW(), updated timestamp );
allow options: 0 deny, 1 allow
CREATE TABLE mqtt_acl( id serial PRIMARY KEY, username varchar(32) NOT NULL, topic varchar(256) NOT NULL, access smallint DEFAULT 3 NOT NULL, created timestamp with time zone DEFAULT NOW(), updated timestamp );
CREATE INDEX mqtt_acl_username_idx ON mqtt_acl(username);
access options: 0 deny、1 publish (Write)、2 subscribe (Read)、3 pubsub (ReadWrite)
Hey,
Hope you are doing well! Could you please help me to find the best way to create postgres database/tables. If it possible may you share a postgres schema?!
Thank you in advance, Alex