Files
inventory-plus-plus/database_migrations/000008_etsy_access_tokens.up.sql

20 lines
503 B
SQL

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
);