Add command to tag workspace as suspended or as deleted (#9610)
In this PR: - remove old versions upgrade commands - add a 0.40 upgrade command to loop over all INACTIVE workspaces and either: update to SUSPENDED (if workspaceSchema exists), update them to SUSPENDED + deletedAt (if workspaceSchema does not exist anymore) Note: why updating the deleted one to SUSPENDED? Because I plan to remove INACTIVE case in the enum in 0.41 Tests made on production like database: - dry-mode - singleWorkspaceId - 3 cases : suspended, deleted+suspended, deleted+suspended+delete all data
This commit is contained in:
@ -4,6 +4,7 @@ import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
OneToMany,
|
||||
@ -77,7 +78,7 @@ export class User {
|
||||
updatedAt: Date;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Column({ nullable: true, type: 'timestamptz' })
|
||||
@DeleteDateColumn({ type: 'timestamptz' })
|
||||
deletedAt: Date;
|
||||
|
||||
@OneToMany(() => AppToken, (appToken) => appToken.user, {
|
||||
|
||||
@ -4,6 +4,7 @@ import { IDField, UnPagedRelation } from '@ptc-org/nestjs-query-graphql';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Entity,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
@ -67,7 +68,7 @@ export class Workspace {
|
||||
inviteHash?: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Column({ nullable: true, type: 'timestamptz' })
|
||||
@DeleteDateColumn({ type: 'timestamptz' })
|
||||
deletedAt?: Date;
|
||||
|
||||
@Field()
|
||||
|
||||
Reference in New Issue
Block a user