Link articlehistory to companyuser; store Google picture and sub on google_auth

This commit is contained in:
seb
2026-08-05 10:57:50 +02:00
parent 46c85fe29e
commit d1eb2716ae
12 changed files with 1284 additions and 1191 deletions

View File

@@ -1,10 +1,10 @@
export const INSERT = `
INSERT INTO articlehistory (article_id, [text])
VALUES (@articleId, @text)
INSERT INTO articlehistory (article_id, companyuser_id, [text])
VALUES (@articleId, @companyuserId, @text)
`;
export const LIST_BY_ARTICLE_ID = `
SELECT id, [date], [text]
SELECT id, companyuser_id AS companyuserId, [date], [text]
FROM articlehistory
WHERE article_id = @articleId
ORDER BY [date] DESC, id DESC

View File

@@ -5,13 +5,25 @@ VALUES (@email)
`;
export const GET_BY_EMAIL = `
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
SELECT
id,
email,
picture,
sub,
created_at AS createdAt,
selected_company AS selectedCompanyId
FROM google_auth
WHERE email = @email
`;
export const LIST_ALLOWED_EMAILS = `
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
SELECT
id,
email,
picture,
sub,
created_at AS createdAt,
selected_company AS selectedCompanyId
FROM google_auth
ORDER BY email
`;
@@ -26,3 +38,9 @@ UPDATE google_auth
SET selected_company = @companyId
WHERE id = @googleAuthId
`;
export const SET_PROFILE = `
UPDATE google_auth
SET picture = @picture, sub = @sub
WHERE id = @googleAuthId
`;