CREATE TABLE etsy_users (
	account_id  INTEGER		NOT NULL,
	user_id 	INTEGER		NOT NULL,
	store_id 	INTEGER		NOT NULL,

	PRIMARY KEY (user_id),
	FOREIGN KEY (account_id) REFERENCES accounts
);

CREATE TABLE etsy_access_tokens (
	user_id 					INTEGER			NOT NULL,
	access_token 				TEXT			NOT NULL,
	refresh_token 				TEXT			NOT NULL,
	access_token_expiration 	TIMESTAMPTZ		NOT NULL,
	refresh_token_expiration 	TIMESTAMPTZ		NOT NULL,

	PRIMARY KEY (user_id),
	FOREIGN KEY (user_id) REFERENCES etsy_users
);
