Skip to content

Commit bf6fb10

Browse files
committed
Add to migrations and update docs.
Addresses datamweb#186.
1 parent 82f07b6 commit bf6fb10

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Therefore, you can add `first_name`, `last_name`, and `avatar` columns to table
5353
php spark migrate -n Datamweb\ShieldOAuth
5454
```
5555

56+
The default size of the `username` field created by Shield is **30** characters. Since Oauth uses the `username` field for the user's email address, this often is not large enough. Consider increasing the size of this field to `VARCHAR(100)`. _The migrations make this change for you_.
57+
5658
> **Note**
5759
> By default, `Shield OAuth` uses columns named `first_name`, `last_name`, and `avatar`.
5860
> For any reason, if you want to consider another name for them columns, you can do it through the config file(`config/ShieldOAuthConfig.php`) and set the desired values in:

src/Database/Migrations/2022-10-20-182737_ShieldOAuth.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ public function up(): void
5454
];
5555

5656
$this->forge->addColumn('users', $fields);
57+
58+
$fields2 = [
59+
'username' => [
60+
'type' => 'VARCHAR(256)',
61+
'null' => true,
62+
]
63+
];
64+
65+
// use 'modify' since the prerequisite Shield plugin will certainly have created this column
66+
$this->forge->modifyColumn('users', $fields2);
5767
}
5868

5969
public function down(): void

0 commit comments

Comments
 (0)