1 -- This SQL contains a "create table" that can be used to create a table that JdbcUsersConnectionRepository can persist
2 -- connection in. It is, however, not to be assumed to be production-ready, all-purpose SQL. It is merely representative
3 -- of the kind of table that JdbcUsersConnectionRepository works with. The table and column names, as well as the general
4 -- column types, are what is important. Specific column types and sizes that work may vary across database vendors and
5 -- the required sizes may vary across API providers.
7 create table UserConnection (userId varchar(255) not null,
8 providerId varchar(255) not null,
9 providerUserId varchar(255),
11 displayName varchar(255),
12 profileUrl varchar(512),
13 imageUrl varchar(512),
14 accessToken varchar(512) not null,
16 refreshToken varchar(512),
18 primary key (userId, providerId, providerUserId));
19 create unique index UserConnectionRank on UserConnection(userId, providerId, rank);