-- Users table to hold account information
-- Postgres dialect

create table users (
    id serial primary key,
    username text not null unique,
    password_hash text not null,
    stellar_address text not null unique,
    email text unique,
    is_active boolean not null default true,
    roles text[] not null default '{}',
    last_login_at timestamptz,
    created_at timestamptz not null default now(),
    updated_at timestamptz not null default now()
);

-- Optional helpful indexes (unique already creates indexes, but adding a lower() index for case-insensitive lookups could be considered later)
