/*
    This script inserts a default administrator with username 'admin' into the table 'medusa_admin'.
*/

-- Comment out 'SET sqlblanklines on' if you're using a SQL client other than Oracle SQL*Plus
SET sqlblanklines on

DELETE
FROM medusa_admin
WHERE username = 'admin';

INSERT INTO medusa_admin (username,
                          givenname,
                          surname,
                          roles,
                          pwd_hash,
                          pwd_chg_enf)
VALUES ('admin',
        'IAM',
        'Administrator',
        'superadmin',
        'MedusaPwdHistoryAAAARjE2Mzg0fF1jjOhya0ZuJ5OrHXgSXznOBBLl6eJ70PTdFYerSYPwgrlK1uq6UCzc5cvN8t1xtgc+YBQO8UgWBYhzDgpkQGM=',
        1 /* Password change enforced */
       );

/*
    Depending on auto commit settings of Oracle, this line is necessary or
    may be superfluous. If no auto commit is enabled and no no commit is done;
    the process will block on Oracle, i.e. the administrator is not visible
    for other processes, or - even worse - also blocks other processes
    infinitely.
*/
COMMIT;
