-- +goose Up
-- +goose StatementBegin
CREATE TABLE sms_code_sends(
    id SERIAL8 PRIMARY KEY,
    phone varchar(20) NOT NULL,
    code varchar(20) NOT NULL,
    sent_at timestamp NOT NULL DEFAULT now(),
    expires_at timestamp NOT NULL
);

CREATE INDEX idx_sms_code_sends_phone ON sms_code_sends(phone);
CREATE INDEX idx_sms_code_sends_sent_at ON sms_code_sends(sent_at);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE sms_code_sends;
-- +goose StatementEnd

