CREATE TABLE users
(
    id         SERIAL PRIMARY KEY,
    username   VARCHAR(255) UNIQUE NOT NULL,
    password   VARCHAR(255)        NOT NULL,
    email      VARCHAR(255) UNIQUE NOT NULL,
    role       VARCHAR(255)        NOT NULL,
    created_at TIMESTAMP           NOT NULL,
    updated_at TIMESTAMP           NOT NULL
);

CREATE TABLE user_logins
(
    id         SERIAL PRIMARY KEY,
    user_id    BIGINT       NOT NULL,
    login_time TIMESTAMP    NOT NULL,
    login_ip   VARCHAR(255) NOT NULL,
    FOREIGN KEY (user_id) REFERENCES users (id)
);