From f376bf88e590bd262e64e46f7861fe18870100ee Mon Sep 17 00:00:00 2001 From: Tobias Oitzinger <42447585+toitzi@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:07:53 +0100 Subject: [PATCH] Clearify encrypted columns need to be null by default (#262) --- source/docs/v3/tenant-attribute-encryption.blade.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/docs/v3/tenant-attribute-encryption.blade.md b/source/docs/v3/tenant-attribute-encryption.blade.md index 8eba1b1..01a00be 100644 --- a/source/docs/v3/tenant-attribute-encryption.blade.md +++ b/source/docs/v3/tenant-attribute-encryption.blade.md @@ -10,7 +10,7 @@ To encrypt attributes on the Tenant model, store them in [custom columns]({{ $pa For example, we'll encrypt the tenant's database credentials – `tenancy_db_username` and `tenancy_db_password`. We need to create custom columns for these attributes, because by default, they are stored in the virtual `data` column. -- Add custom columns to the tenants table (we recommend making the string size at least 512 characters, so the string is capable of containing the encrypted data): +- Add custom columns to the tenants table (we recommend making the string size at least 512 characters, so the string is capable of containing the encrypted data, they also need to be `nullable` since they are filled after creation): ```php string('id')->primary(); // Your custom columns - $table->string('tenancy_db_username', 512); - $table->string('tenancy_db_password', 512); + $table->string('tenancy_db_username', 512)->nullable(); + $table->string('tenancy_db_password', 512)->nullable(); $table->timestamps(); $table->json('data')->nullable();