-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Officially support PostgreSQL database #1066
base: main
Are you sure you want to change the base?
Conversation
database/migrations/2017_11_19_122708_MigratePubPrivFormatToSingleKey.php
Show resolved
Hide resolved
Do changing all these migrations break new installs for SQLite and MySQL? |
@@ -14,7 +14,7 @@ public function up(): void | |||
$table->string('id')->primary(); | |||
$table->string('type'); | |||
$table->morphs('notifiable'); | |||
$table->text('data'); | |||
$table->json('data'); |
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.
Postgres should basically never use json
. Always jsonb
. There's a bunch of JSON operations in the code that depend on the database being able to understand the JSON, which is impossible with json
.
@@ -33,6 +33,13 @@ protected function getFormActions(): array | |||
return []; | |||
} | |||
|
|||
protected function prepareForValidation($attributes): array | |||
{ | |||
$attributes['data']['email'] = strtolower($attributes['data']['email']); |
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.
$attributes['data']['email'] = strtolower($attributes['data']['email']); | |
$attributes['data']['email'] = mb_strtolower($attributes['data']['email']); |
@@ -179,6 +179,10 @@ protected static function booted(): void | |||
return true; | |||
}); | |||
|
|||
static::saving(function (self $user) { | |||
$user->email = strtolower($user->email); |
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.
$user->email = strtolower($user->email); | |
$user->email = mb_strtolower($user->email); |
No description provided.