spacer gif
spacer gif

DB TABLE auth_role WILL BE CREATED!

--
-- DB TABLES :: app=login
-- TABLE     :: auth_role
-- SEQUENCE  :: auth_role_id_seq
--

-- DROP TABLE auth_role;
-- DROP SEQUENCE auth_role_id_seq;

--
-- TABLE :: auth_role
--
CREATE TABLE auth_role (
    auth_role_id integer NOT NULL,
    role character varying(50),
    description character varying(255),
    remarks character varying(255),
    credtm timestamp(0) without time zone DEFAULT now(),
    creusr character varying(32) DEFAULT "current_user"(),
    upddtm timestamp(0) without time zone DEFAULT now(),
    updusr character varying(32) DEFAULT "current_user"()
);
--
ALTER TABLE public.auth_role OWNER TO nobody;
ALTER TABLE ONLY auth_role ADD CONSTRAINT auth_role_pkey PRIMARY KEY (auth_role_id);
CREATE UNIQUE INDEX auth_role_role_uidx ON auth_role USING btree (role);
--
REVOKE ALL ON TABLE auth_role FROM PUBLIC;
REVOKE ALL ON TABLE auth_role FROM nobody;
GRANT ALL ON TABLE auth_role TO nobody;
GRANT SELECT,INSERT,UPDATE ON TABLE auth_role TO PUBLIC;

--
-- COMMENTS :: auth_role
--
COMMENT ON TABLE auth_role IS 'List of roles and permissions for logged in users.';
--
COMMENT ON COLUMN auth_role.auth_role_id IS 'PK (Primary key)';
COMMENT ON COLUMN auth_role.role IS 'Role (controlled vocubulary)';

--
-- SEQUENCE :: auth_role_id_seq
--
CREATE SEQUENCE auth_role_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
--
ALTER TABLE public.auth_role_id_seq OWNER TO nobody;
ALTER SEQUENCE auth_role_id_seq OWNED BY auth_role.auth_role_id;
ALTER TABLE auth_role ALTER COLUMN auth_role_id SET DEFAULT nextval('auth_role_id_seq'::regclass);
--
REVOKE ALL ON SEQUENCE auth_role_id_seq FROM PUBLIC;
--REVOKE ALL ON SEQUENCE auth_role_id_seq FROM nobody;
GRANT ALL ON SEQUENCE auth_role_id_seq TO nobody;
GRANT SELECT,UPDATE ON SEQUENCE auth_role_id_seq TO PUBLIC;

--
-- Default role admin, contacts, ...
--
INSERT INTO auth_role (auth_role_id, role)
    VALUES (nextval('auth_role_id_seq'), 'admin');

INSERT INTO auth_role (auth_role_id, role)
    VALUES (nextval('auth_role_id_seq'), 'contacts');


FAILED TO RUN SQL SCRIPT (auth_role.sql)
ERROR: permission denied for schema public LINE 13: CREATE TABLE auth_role ( ^