- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.7k
[4.0] [com_privacy] Fix default value for not nullable datetime columns #26461
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
Changes from 7 commits
be6f814
              eca11bc
              1e76ce3
              eb5a78c
              6d39c82
              67a5139
              ab46044
              cfbc030
              4783de1
              e8acb11
              03d2768
              18763ad
              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 | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ALTER TABLE `#__privacy_requests` MODIFY `requested_at` datetime NOT NULL; | ||
| ALTER TABLE `#__privacy_requests` MODIFY `confirm_token_created_at` datetime NOT NULL; | ||
|  | ||
| ALTER TABLE `#__privacy_consents` MODIFY `created` datetime NOT NULL; | ||
|  | ||
| UPDATE `#__privacy_requests` SET `confirm_token_created_at` = `requested_at` WHERE `confirm_token_created_at` = '0000-00-00 00:00:00'; | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ALTER TABLE "#__privacy_requests" ALTER COLUMN "requested_at" DROP DEFAULT; | ||
| ALTER TABLE "#__privacy_requests" ALTER COLUMN "confirm_token_created_at" DROP DEFAULT; | ||
|  | ||
| ALTER TABLE "#__privacy_consents" ALTER COLUMN "created" DROP DEFAULT; | ||
|  | ||
| UPDATE "#__privacy_requests" SET "confirm_token_created_at" = "requested_at" WHERE "confirm_token_created_at" = '1970-01-01 00:00:00'; | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -67,6 +67,11 @@ public function store($updateNulls = false) | |
| { | ||
| $this->requested_at = $date->toSql(); | ||
| } | ||
|  | ||
| if (!$this->confirm_token_created_at) | ||
| { | ||
| $this->confirm_token_created_at = $date->toSql(); | ||
| 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. What is this in real life? doesn't this need to be nullable until the confirm token is actually created? 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. Good question. To be honest, I don’t remember right now why I‘ve done it that way. Will check later today or tomorrow and if necessary correct that. Any hint where in code this token is created would be very welcome. 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. Found where the token is set. Will check later what to do here at this place. | ||
| } | ||
| } | ||
|  | ||
| return parent::store($updateNulls); | ||
|  | ||
Uh oh!
There was an error while loading. Please reload this page.