mirror of
https://github.com/immich-app/immich.git
synced 2026-02-12 11:58:15 +03:00
set readonly=true as default for new album shares
This commit is contained in:
@@ -15,7 +15,6 @@ export class AlbumPermissionEntity {
|
||||
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
|
||||
users!: UserEntity;
|
||||
|
||||
// Readonly is false when migrating previous entries
|
||||
@Column({ default: false })
|
||||
@Column({ default: true })
|
||||
readonly!: boolean;
|
||||
}
|
||||
|
||||
14
server/src/migrations/1712905931092-SetReadonlyDefault.ts
Normal file
14
server/src/migrations/1712905931092-SetReadonlyDefault.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class SetReadonlyDefault1712905931092 implements MigrationInterface {
|
||||
name = 'SetReadonlyDefault1712905931092'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "albums_shared_users_users" ALTER COLUMN "readonly" SET DEFAULT true`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "albums_shared_users_users" ALTER COLUMN "readonly" SET DEFAULT false`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user