DROP TABLE IF EXISTS USERS;
CREATE TABLE USERS (
    id BIGINT NOT NULL AUTO_INCREMENT,
    username VARCHAR(128) NOT NULL UNIQUE,
    password VARCHAR(72) NOT NULL,
    authorities VARCHAr(128) NOT NULL DEFAULT '',
    accountNonExpired BOOLEAN NOT NULL DEFAULT '1',
    accountNonLocked BOOLEAN NOT NULL DEFAULT '1',
    credentialsNonExpired BOOLEAN NOT NULL DEFAULT '1',
    enabled BOOLEAN NOT NULL DEFAULT '1',
    prefixx VARCHAR(20) NOT NULL DEFAULT '',
    firstName VARCHAR(32) NOT NULL DEFAULT '',
    middleName VARCHAR(32) NOT NULL DEFAULT '',
    lastName VARCHAR(32) NOT NULL DEFAULT '',
    suffix VARCHAR(40) NOT NULL DEFAULT '',
    email VARCHAR(256) NOT NULL DEFAULT '',
    birthdate DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
    preferredIdentifier VARCHAR(1024) NOT NULL DEFAULT 'unset',
    PRIMARY KEY (Id)
);

DROP TABLE IF EXISTS AUTHORITIES;
CREATE TABLE AUTHORITIES (
    id BIGINT NOT NULL AUTO_INCREMENT,
    authority VARCHAR(32) NOT NULL,
    PRIMARY KEY (id)
); 


