change role back to editor as DB default

This commit is contained in:
mgabor
2024-04-24 12:38:24 +02:00
parent 757d8c9e7c
commit 8b73b92335
2 changed files with 1 additions and 2 deletions

View File

@@ -26,6 +26,6 @@ export class AlbumUserEntity {
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
user!: UserEntity;
@Column({ type: 'varchar', default: 'viewer' })
@Column({ type: 'varchar', default: AlbumUserRole.EDITOR })
role!: AlbumUserRole;
}

View File

@@ -5,7 +5,6 @@ export class AddAlbumUserRole1713337511945 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "albums_shared_users_users" ADD "role" character varying NOT NULL DEFAULT 'editor'`);
await queryRunner.query(`ALTER TABLE "albums_shared_users_users" ALTER COLUMN "role" SET DEFAULT 'viewer'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {