-- when a user authorizes our application to signup, we create this row
CREATE UNLOGGED TABLE facebook_signups (
  id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
  lookup_id VARCHAR(255) UNIQUE NOT NULL,
  last_name VARCHAR(100),
  first_name VARCHAR(100),
  gender VARCHAR(1),
  email VARCHAR(1024),
  uid VARCHAR(1024),
  token VARCHAR(1024),
  token_expires_at TIMESTAMP,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

ALTER TABLE user_authorizations ADD CONSTRAINT user_authorizations_uniqkey UNIQUE (provider, uid);