-
Notifications
You must be signed in to change notification settings - Fork 19
Add to migrations and update docs. #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -54,6 +54,16 @@ public function up(): void | |||||||||||||||||||||||||||||||||||||
]; | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
$this->forge->addColumn('users', $fields); | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
$fields2 = [ | ||||||||||||||||||||||||||||||||||||||
'username' => [ | ||||||||||||||||||||||||||||||||||||||
'type' => 'VARCHAR(256)', | ||||||||||||||||||||||||||||||||||||||
'null' => true, | ||||||||||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||||||||||
]; | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
// use 'modify' since the prerequisite Shield plugin will certainly have created this column | ||||||||||||||||||||||||||||||||||||||
$this->forge->modifyColumn('users', $fields2); | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+58
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Size discrepancy between migration and documentation. The migration is setting the username field to VARCHAR(256), but the documentation in install.md suggests VARCHAR(100). Consider aligning these values for consistency. $fields2 = [
'username' => [
- 'type' => 'VARCHAR(256)',
+ 'type' => 'VARCHAR(100)',
'null' => true,
]
]; Alternatively, update the documentation to reflect the actual size being set. 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
public function down(): void | ||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Inconsistent column type declaration format.
The way you're defining the type for the username column is inconsistent with the format used for other columns in this file. Other columns separate 'type' and 'constraint', but here they're combined.
📝 Committable suggestion