-
Notifications
You must be signed in to change notification settings - Fork 0
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
Order attributes #170
base: master
Are you sure you want to change the base?
Order attributes #170
Conversation
common/models/Order.php
Outdated
@@ -343,4 +357,18 @@ public function afterSave($insert, $changedAttributes) | |||
} | |||
} | |||
} | |||
|
|||
protected function executeAfterFind(): 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.
{ | ||
$this->addColumn('{{%orders}}', 'order_attributes', | ||
$this | ||
->text() |
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.
I needed the method
But anyway I moved it to the |
Working on checking this but my local machine is running slow. Trying to reduce the dataset. |
Won't the real dataset be even larger? |
Yes. And I'm not sure why it is running slow. I'm going to copy production to another database on Digital Oceans server and run the migration against it. |
After adding the field? |
Yes. And I'm not sure why it is running slow. I'm going to copy production to another database on Digital Oceans server and run the migration against it. It just sits there while trying to add the field. I tried from the mysql cli too. |
A good idea is to give @bohdan-vorona a DB dump so he reproduce/fix it. |
Good idea. I'll get a sql dump today for you @bohdan-vorona |
@cgsmith @samdark It turned out a pretty tricky thing... On my local machine it took almost 300 seconds (5 minutes) to execute the query:
To be short, it will take lots of time to add a new field to the table The "faster" way: (except the direct query execution)
Total time approximately: ~9-10 minutes (on my local machine). So: Option A. Just apply the migration as is. Probably for this purpose, it would be better to have a column, not a separate table. In addition, as a separate task, I'd propose to:
Option B. Create a new table - Option C. Create a new table but with keeping in mind then potentially we can extend the table with other columns in future. Let's name it BTW it takes lots of time also removing the column 😁 |
That sounds alright. @cgsmith let's apply that during "maintenance window"? |
#165
Listing:
View:
Add/Update:
API: