spacer gif
spacer gif

DB TABLE auth_user_md5 WILL BE CREATED!

--
-- DB TABLES :: app=login
-- TABLE     :: auth_user_md5
-- SEQUENCE  :: auth_user_id_seq
--

-- DROP TABLE auth_user_md5;
-- DROP SEQUENCE auth_user_id_seq;

--
-- TABLE :: auth_user_md5
--
CREATE TABLE auth_user_md5 (
    auth_user_id integer NOT NULL,
    username character varying(32) DEFAULT ''::character varying NOT NULL,
    password character varying(32) DEFAULT ''::character varying NOT NULL,
    email character varying(255),
    active boolean DEFAULT true,
    person_id integer,
--    perms character varying(255),
--    password_phplib character varying(32),
--    uid character varying(32),
--    user_id character varying(32),
    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_user_md5 OWNER TO nobody;
ALTER TABLE ONLY auth_user_md5
    ADD CONSTRAINT auth_user_md5_pkey PRIMARY KEY (auth_user_id);
CREATE UNIQUE INDEX auth_user_md5_username_uidx ON auth_user_md5 USING btree (username);
--
REVOKE ALL ON TABLE auth_user_md5 FROM PUBLIC;
-- REVOKE ALL ON TABLE auth_user_md5 FROM nobody;
GRANT ALL ON TABLE auth_user_md5 TO nobody;
GRANT SELECT ON TABLE auth_user_md5 TO PUBLIC;

--
-- COMMENTS :: auth_user_md5
--
COMMENT ON TABLE auth_user_md5 IS 'This table is starting from the PHPLIB user table. Using MD5 encryption of password.';
--
COMMENT ON COLUMN auth_user_md5.auth_user_id IS 'PK (Primary key)';
COMMENT ON COLUMN auth_user_md5.username IS 'LOGIN username';
COMMENT ON COLUMN auth_user_md5.password IS 'MD5 hash';
COMMENT ON COLUMN auth_user_md5.email IS 'Email if adding forgot password reminder';
COMMENT ON COLUMN auth_user_md5.active IS 'Set to false to deactivate user';
COMMENT ON COLUMN auth_user_md5.person_id IS 'FK to person';
-- COMMENT ON COLUMN auth_user_md5.user_id IS 'Rudiment from PHPLIB';
-- COMMENT ON COLUMN auth_user_md5.perms IS 'Permission from PHPLIB';
-- COMMENT ON COLUMN auth_user_md5.uid IS 'PK from PHPLIB';

--
-- SEQUENCE :: auth_user_md5_user_id_seq
--
CREATE SEQUENCE auth_user_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
--
ALTER TABLE public.auth_user_id_seq OWNER TO nobody;
ALTER SEQUENCE auth_user_id_seq OWNED BY auth_user_md5.auth_user_id;
ALTER TABLE auth_user_md5 ALTER COLUMN auth_user_id SET DEFAULT nextval('auth_user_id_seq'::regclass);
--
REVOKE ALL ON SEQUENCE auth_user_id_seq FROM PUBLIC;
-- REVOKE ALL ON SEQUENCE auth_user_id_seq FROM nobody;
GRANT ALL ON SEQUENCE auth_user_id_seq TO nobody;
GRANT SELECT ON SEQUENCE auth_user_id_seq TO PUBLIC;

--
-- Default user: admin, dag.endresen
-- Default password is 'password' -- NB! remember to change this
--
INSERT INTO auth_user_md5 (username, password, email, person_id)
    VALUES ('admin', 'a945cda0b8102c46d94d9231005efb3c', 'dag.endresen@nordgen.org', 0);

INSERT INTO auth_user_md5 (username, password, email, person_id)
    VALUES ('dagterje', 'a945cda0b8102c46d94d9231005efb3c', 'dag.endresen@nordgen.org', 1);



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