-- 2023-10-28: Add email/password login

-- +migrate Up

alter table users add column password bytea null;
alter table users add column salt bytea null;

create table user_emails (
    id                 bigint primary key,
    user_id            bigint not null references users (snowflake_id) on delete cascade,
    email_address      text not null unique
);

-- +migrate Down

alter table users drop column password;
alter table users drop column salt;

drop table user_emails;
