feat: per bucket image transformations flag

This commit is contained in:
Chirag Aggarwal
2025-10-28 14:13:38 +05:30
parent 0e6d3279d7
commit 4aaaa460b2
10 changed files with 167 additions and 6 deletions
+1
View File
@@ -150,6 +150,7 @@ class Exception extends \Exception
public const string STORAGE_INVALID_RANGE = 'storage_invalid_range';
public const string STORAGE_INVALID_APPWRITE_ID = 'storage_invalid_appwrite_id';
public const string STORAGE_FILE_NOT_PUBLIC = 'storage_file_not_public';
public const string STORAGE_BUCKET_TRANSFORMATIONS_DISABLED = 'storage_bucket_transformations_disabled';
/** VCS */
public const string INSTALLATION_NOT_FOUND = 'installation_not_found';
+10
View File
@@ -136,6 +136,16 @@ class V23 extends Migration
break;
}
}
try {
$this->createAttributeFromCollection(
$this->dbForPlatform,
'buckets',
'transformations',
);
} catch (Throwable $th) {
Console::warning("'transformations' from 'buckets': {$th->getMessage()}");
}
}
/**
@@ -10,7 +10,8 @@ class Buckets extends Base
'fileSecurity',
'maximumFileSize',
'encryption',
'antivirus'
'antivirus',
'transformations',
];
/**
@@ -86,6 +86,12 @@ class Bucket extends Model
'default' => true,
'example' => false,
])
->addRule('transformations', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Image transformations are enabled.',
'default' => true,
'example' => false,
])
;
}