Closed IraIvanishak closed 3 months ago
-- +goose Up
-- +goose StatementBegin
CREATE TABLE username_redirects
(
id BIGSERIAL NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users (id),
social_provider SOCIAL_PROVIDER NOT NULL,
canonical_username VARCHAR NOT NULL,
UNIQUE (canonical_username, social_provider)
);
CREATE TABLE username_history
(
id BIGSERIAL NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users (id),
social_provider SOCIAL_PROVIDER NOT NULL,
canonical_username VARCHAR NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
UNIQUE (canonical_username, social_provider, user_id)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE username_history;
DROP TABLE username_redirects;
-- +goose StatementEnd
Description https://github.com/u8views/go-u8views/issues/28