diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/Pg-database.sql | 16 | ||||
-rw-r--r-- | sql/modules/admin.sql | 4 |
2 files changed, 4 insertions, 16 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index e57d0b1c..76b22079 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -131,27 +131,13 @@ COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the c --INSERT INTO users(username) VALUES ('admin'); -- entity_id is declared NOT NULL !! - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - - - INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -CREATE OR REPLACE FUNCTION create_user(text) RETURNS bigint AS $$ - INSERT INTO users(username) VALUES ($1); - SELECT currval('users_id_seq'); - $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION create_user(text) IS $$ Function to create user. Returns users.id if successful, else it is an error. $$; -CREATE OR REPLACE FUNCTION update_user(int4,text) RETURNS int4 AS $$ - UPDATE users SET username = $2 WHERE id = $1; - SELECT 1; - $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION update_user(int4,text) IS $$ Takes int4 which is users.id and text which is username. Will update username based on id. Username is unique $$; -- Session tracking table diff --git a/sql/modules/admin.sql b/sql/modules/admin.sql index 103c10c1..6b6aecfb 100644 --- a/sql/modules/admin.sql +++ b/sql/modules/admin.sql @@ -400,4 +400,6 @@ $$ language 'plpgsql'; comment on function admin_delete_group(text) IS $$ Deletes the input group from the database. Not designed to be used to remove a login-capable user. -$$;
\ No newline at end of file +$$; + +-- TODO: Add admin user |