テーブル分割

This commit is contained in:
syuilo
2019-04-10 15:04:27 +09:00
parent 9603f3fa4f
commit 626cfb61ac
33 changed files with 267 additions and 232 deletions

View File

@ -8,7 +8,7 @@ import redis from '../../../db/redis';
import * as uuid from 'uuid';
import signin from '../common/signin';
import fetchMeta from '../../../misc/fetch-meta';
import { Users, UserServiceLinkings } from '../../../models';
import { Users, UserProfiles } from '../../../models';
import { ILocalUser } from '../../../models/entities/user';
function getUserToken(ctx: Koa.BaseContext) {
@ -45,7 +45,7 @@ router.get('/disconnect/github', async ctx => {
token: userToken
});
await UserServiceLinkings.update({
await UserProfiles.update({
userId: user.id
}, {
github: false,
@ -191,7 +191,7 @@ router.get('/gh/cb', async ctx => {
return;
}
const link = await UserServiceLinkings.createQueryBuilder()
const link = await UserProfiles.createQueryBuilder()
.where('github @> :github', {
github: {
id: id,
@ -263,7 +263,7 @@ router.get('/gh/cb', async ctx => {
token: userToken
});
await UserServiceLinkings.update({ userId: user.id }, {
await UserProfiles.update({ userId: user.id }, {
github: true,
githubAccessToken: accessToken,
githubId: id,