This repository has been archived on 2022-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
elon-eats-my-tweets/sql/migrations/20220520201518_add_users_ta...

17 lines
621 B
MySQL
Raw Normal View History

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE users (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
2022-05-20 22:34:20 +00:00
twitter_id CHARACTER VARYING(256) NOT NULL,
username CHARACTER VARYING(255) NOT NULL,
name CHARACTER VARYING(255) NOT NULL,
access_token CHARACTER VARYING(512) NOT NULL,
refresh_token CHARACTER VARYING(512) NOT NULL,
delete_tweets_enabled boolean NOT NULL DEFAULT false,
2022-05-20 22:34:20 +00:00
delete_tweets_num_per_iteration int NOT NULL DEFAULT 1,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL
2022-05-20 22:34:20 +00:00
);
CREATE UNIQUE INDEX index_users_on_twitter_id ON users (twitter_id);