Andy Brett
7814e74649
remove migration
2021-02-10 08:56:35 -08:00
Pau Pérez Fabregat
41410fdab5
Merge pull request #6834 from andrewpbrett/fix-variants-with-no-products
...
Remove variants with no product
2021-02-09 12:07:54 +01:00
Andy Brett
9a2bf9d333
use #destroy_all
2021-02-08 13:12:40 -08:00
Andy Brett
8f59d76eb2
remove variants with no product
2021-02-08 08:57:11 -08:00
Maikel
173cf9e536
Merge pull request #6565 from Matt-Yorkley/adjustments-inclusive
...
[Adjustments] Improve inclusive/additional tax recording
2021-02-08 09:38:31 +11:00
Andy Brett
1e863c6e65
Merge branch 'master' into migrate-variant-unit-values
2021-02-04 13:27:30 -08:00
Andy Brett
9c135ee0f7
add default to unit_value and weight
2021-02-04 13:17:43 -08:00
Andy Brett
212186e059
check all variants, not just where we use 'items'
2021-02-04 11:45:36 -08:00
Andy Brett
d642984261
add db constraint; check for existing nil/nan in migration
2021-02-04 11:24:35 -08:00
Andy Brett
91245ae6ab
also set weight to default to 0.0
2021-02-04 08:05:48 -08:00
Luis Ramos
e5e2402a7c
Add migrate to rename Migs payments to check
2021-02-03 21:53:15 +00:00
Andy Brett
142af0055c
use #find_each instead of #each
2021-02-02 09:40:17 -08:00
Andy Brett
109a3da104
use more efficient query; enforce not null at db level
2021-02-02 09:32:47 -08:00
Andy Brett
850dfd776a
migrate variants with nil unit_value
2021-02-01 21:27:32 -08:00
Matt-Yorkley
4ec68dcd85
Update migration to include TaxRate model
2021-01-29 02:37:35 +00:00
Matt-Yorkley
d502320b14
Enable cascading deletes
2021-01-28 21:51:47 +00:00
Pau Perez
5677c86f9b
Remove enable_mail_delivery preference from DB
...
It's no longer used.
2021-01-25 13:34:13 +01:00
Matt-Yorkley
66bf69b52c
Add included column to spree_adjustments table
2021-01-23 03:59:31 +00:00
Matt-Yorkley
d8b795ebee
Merge pull request #6679 from Matt-Yorkley/soft-delete-enterprise-fees
...
Soft-delete Enterprise Fees
2021-01-21 19:57:29 +01:00
Andy Brett
dd38c8b3e2
add down method for migration
2021-01-20 12:56:03 -08:00
Matt-Yorkley
e1c13bc194
Fix issue with orphaned adjustments in migration
2021-01-20 13:42:14 +00:00
Matt-Yorkley
c4a8a38c8d
Soft-delete enterprise fees
...
These objects can hold critical information related to adjustments and tax categories. If they are hard-deleted we lose vital data that's needed by associated records.
2021-01-19 16:46:14 +00:00
Matt-Yorkley
79b86f535d
Move class definitions in adjustment migration
2021-01-19 13:33:37 +00:00
Matt-Yorkley
1eb08ba31c
Define basic models in migration
2021-01-15 16:17:18 +00:00
Matt-Yorkley
ca4de40fa2
Associate all adjustments with an order
...
This change is introduced in the adjustments updates from Spree 2.2 and used heavily in new scopes and methods (not included here).
2021-01-11 17:35:35 +00:00
Luis Ramos
e5b7c036d5
Repeat calculator migrations to clean up existing data
2020-11-13 16:35:22 +00:00
Luis Ramos
4d64bf6ece
Add column to customers table to register last time enterprise terms and
...
conditions were accepted so customer doesnt have to accept terms on all
checkouts but only when the enterprise updates the terms file
2020-10-30 15:09:13 +00:00
Maikel
8c65498661
Merge pull request #5998 from andrewpbrett/shipping-per-pound
...
Per-pound shipping calculator
2020-10-16 15:27:57 +11:00
Andy Brett
ca24068d37
use case-insensitive sql query
2020-10-15 07:55:19 -07:00
Andy Brett
edefe1d4bc
use correct cache key for old preference
2020-09-18 14:35:51 -07:00
Andy Brett
b9ee945062
fix nomethod error by interpolating integer inside string
2020-09-18 10:10:27 -07:00
Andy Brett
dc7b9ed8fa
use sql query to update weight calculator prefs
2020-09-18 09:55:29 -07:00
Andy Brett
843f43eb78
delete cached per_kg preference for all weight calculators
2020-09-17 17:30:43 -07:00
Andy Brett
6466829bdc
fix typo in weight calculator migration
2020-09-17 07:17:25 -07:00
Andy Brett
37cfe65688
migrate existing weight calculators
2020-09-12 12:32:06 -07:00
Luis Ramos
1a734aacf8
Allow user to upload terms and conditions PDF file to an enterprise
2020-08-31 17:40:34 +01:00
Luis Ramos
8f4395a6ea
We need to clear Rails cache after updating preferences so that the app picks the new values immediately
2020-07-24 13:17:43 +01:00
Luis Ramos
1b31b727c7
Add migration to fix calculator preferences
2020-07-24 13:17:43 +01:00
Luis Ramos
62a3b6b720
Merge pull request #5406 from kristinalim/fix/5300-optimistic_locking_in_stock_items
...
5300 Avoid race conditions in Spree::StockItem
2020-07-17 22:24:59 +01:00
Luis Ramos
eedf31e449
Make migration a bit easier to read
2020-07-07 17:26:24 +01:00
Luis Ramos
e225c5ce3a
Migrate calculators to outside spree namespace
2020-07-07 17:26:24 +01:00
Pau Perez
dee61e8b82
Index spree_state_changes.stateful_id column
...
This speeds up a great deal one of the most awful queries our DB servers
execute. It's not rare to see traces above 20s in Datadog 😱 .
In staging, with no traffic, we go from
```
EXPLAIN ANALYZE SELECT COUNT ( * )
FROM spree_state_changes
WHERE spree_state_changes . stateful_id = 2024
AND spree_state_changes . stateful_type = 'Spree::Order';
Planning time: 0.142 ms
Execution time: 9.073 ms
```
to
```
EXPLAIN ANALYZE SELECT COUNT ( * )
FROM spree_state_changes
WHERE spree_state_changes . stateful_id = 2024
AND spree_state_changes . stateful_type = 'Spree::Order';
Planning time: 0.284 ms
Execution time: 0.202 ms
```
2020-07-02 15:39:08 +02:00
Matt-Yorkley
49fb01a3bb
Add assign default value of current time whilst altering NOT NULL constraint
...
This argument in #change_column_null assigns this value where any NULL values are found, but it doesn't alter the table's `:default` value
2020-07-01 10:00:21 +02:00
Matt-Yorkley
57ba2481c4
Require timestamps
2020-06-30 09:09:35 +02:00
Luis Ramos
68946a765e
Make timestamps nullable
2020-06-25 08:47:18 +01:00
Kristina Lim
20fd3c2642
Reset negative count on hand in existing non backorderable stock items
2020-06-24 16:16:58 +01:00
Kristina Lim
e53913756c
Add lock_version to Spree::StockItem
2020-06-24 16:15:37 +01:00
Pau Perez
a81e17f23c
Flush the cache
...
So all preferences are fetch from DB now that they have changed.
2020-06-23 17:23:22 +02:00
Pau Perez
190797717a
Defend from the running the migration twice
...
We only migrate preferences if there are any to migrate.
2020-06-23 17:22:11 +02:00
Pau Perez
0ffa7b3734
Migrate all spree pref. keys to the new format
...
We realized in Spree v2.1 they follow this format instead and this is
what's causing issues to Katuma production.
This will remove the duplicate ones and convert the current preferences
to the new thus, keeping the values.
2020-06-23 16:21:20 +02:00