mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into dissolve_admin_resolver
This commit is contained in:
commit
4be546c68e
@ -10,7 +10,7 @@ Decimal.set({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const constants = {
|
const constants = {
|
||||||
DB_VERSION: '0054-recalculate_balance_and_decay',
|
DB_VERSION: '0055-consistent_deleted_users',
|
||||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
|
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
|
||||||
LOG4JS_CONFIG: 'log4js-config.json',
|
LOG4JS_CONFIG: 'log4js-config.json',
|
||||||
// default log level on production should be info
|
// default log level on production should be info
|
||||||
|
|||||||
@ -103,6 +103,9 @@ export const getUserCreation = async (
|
|||||||
const getCreationMonths = (timezoneOffset: number): number[] => {
|
const getCreationMonths = (timezoneOffset: number): number[] => {
|
||||||
const clientNow = new Date()
|
const clientNow = new Date()
|
||||||
clientNow.setTime(clientNow.getTime() - timezoneOffset * 60 * 1000)
|
clientNow.setTime(clientNow.getTime() - timezoneOffset * 60 * 1000)
|
||||||
|
logger.info(
|
||||||
|
`getCreationMonths -- offset: ${timezoneOffset} -- clientNow: ${clientNow.toISOString()}`,
|
||||||
|
)
|
||||||
return [
|
return [
|
||||||
new Date(clientNow.getFullYear(), clientNow.getMonth() - 2, 1).getMonth() + 1,
|
new Date(clientNow.getFullYear(), clientNow.getMonth() - 2, 1).getMonth() + 1,
|
||||||
new Date(clientNow.getFullYear(), clientNow.getMonth() - 1, 1).getMonth() + 1,
|
new Date(clientNow.getFullYear(), clientNow.getMonth() - 1, 1).getMonth() + 1,
|
||||||
|
|||||||
16
database/migrations/0055-consistent_deleted_users.ts
Normal file
16
database/migrations/0055-consistent_deleted_users.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* MIGRATION TO soft delete user contacts of soft deleted users */
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
|
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||||
|
await queryFn(`
|
||||||
|
UPDATE user_contacts LEFT JOIN users ON users.email_id = user_contacts.id
|
||||||
|
SET user_contacts.deleted_at = users.deleted_at
|
||||||
|
WHERE user_contacts.deleted_at IS NULL
|
||||||
|
AND users.deleted_at IS NOT NULL;`)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
||||||
|
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {}
|
||||||
Loading…
x
Reference in New Issue
Block a user