mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Clearify encrypted columns need to be null by default
This commit is contained in:
parent
577e8b66f4
commit
903dabdf94
1 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
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
|
```php
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -32,8 +32,8 @@ class CreateTenantsTable extends Migration
|
||||||
$table->string('id')->primary();
|
$table->string('id')->primary();
|
||||||
|
|
||||||
// Your custom columns
|
// Your custom columns
|
||||||
$table->string('tenancy_db_username', 512);
|
$table->string('tenancy_db_username', 512)->nullable();
|
||||||
$table->string('tenancy_db_password', 512);
|
$table->string('tenancy_db_password', 512)->nullable();
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->json('data')->nullable();
|
$table->json('data')->nullable();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue