1
0
go-rss-aggregator/sql/schema/002_users_apikey.sql

11 lines
304 B
SQL

-- +goose Up
ALTER TABLE users ADD COLUMN api_key VARCHAR(64);
-- Sqlite doesn't allow adding a column with a default value that uses a function :(
-- CONSTRAINT DEFAULT ( lower(hex(randomblob(256))) )
-- CONSTRAINT NOT NULL;
-- CONSTRAINT UNIQUE;
-- +goose Down
ALTER TABLE users DROP COLUMN api_key;