Marc-Roig
43f56d426e
fix: two separate queries to update order and inverse order
2023-07-11 13:22:16 +02:00
Marc-Roig
f6246c145d
fix: relations are not returned in the correct order
...
When removing or adding a relation in an entity, other entities from the same Content Type were seeing that same relation reordered.
Cause: We were updating the order of the other entities when we should only be updating the inverse order.
2023-07-11 10:17:06 +02:00
Marc-Roig
e817c74b25
clean inverse order column
2023-06-22 07:59:48 +01:00
Michael Olund
975a3ca03d
Fix knex error when removing existing relations as a batch
...
Added a fallback of 0 after null coalesce
2023-04-21 12:11:16 -07:00
Pierre Noël
64cf2c26c8
add SQL request as a comment
2023-01-25 14:28:28 +01:00
Pierre Noël
6d92bbca8a
use window function for mariaDB and MySQL 8
2023-01-25 14:28:28 +01:00
Pierre Noël
c9df9b7497
fix ambiguous column name
2023-01-25 14:28:28 +01:00
Pierre Noël
c505a62f7e
change WHERE clause to avoid deadlock
2023-01-25 14:28:27 +01:00
Pierre Noël
aad60aab38
change SQL request logic
2023-01-25 14:28:27 +01:00
Marc-Roig
dd98293a55
better filtering in inverse order column
2023-01-13 10:53:30 +01:00
Marc-Roig
8ec567ef9f
move mysql where clause to the correct query
2023-01-03 14:49:00 +01:00
Marc-Roig
036cb8b250
filter by entity id when reordering components
2023-01-02 16:48:02 +01:00
Pierre Noël
0413f278bb
remove use of temporary table for inverse order
2022-12-16 15:54:38 +01:00
Pierre Noël
aef49c5410
Use temporary table even for mysql versions above 5
2022-12-09 15:57:23 +01:00
Pierre Noël
05f3335b2a
reduce temporary table name length
2022-12-06 17:21:48 +01:00
Pierre Noël
b174c7a5d8
use table instead of temporary table for mysql 5
2022-12-06 14:29:56 +01:00
Alexandre BODIN
8faf635975
Merge branch 'main' into fix/relation-mysql-below-8
2022-11-21 17:12:53 +01:00
Alexandre Bodin
69a5133b60
Rename to more generic window functions
2022-11-21 15:00:31 +01:00
Alexandre Bodin
25507f8328
Simplify main PR
2022-11-21 14:30:55 +01:00
Pierre Noël
c11ce77597
remove console log
2022-11-19 02:22:59 +01:00
Pierre Noël
6a530cbbfc
put add-schema in knex util file
2022-11-19 00:01:10 +01:00
Pierre Noël
0c76c5ae1a
add error management
2022-11-18 23:57:46 +01:00
Pierre Noël
9ff4f19660
fix schema support for postgres when using raw queries
2022-11-17 10:08:49 +01:00
Pierre Noël
952a05514f
use knex arguments when dropping the temporary table
2022-11-16 18:36:07 +01:00
Pierre Noël
eba2da51af
refactor the way database version is fetched
2022-11-16 18:32:32 +01:00
Pierre Noël
6103e4de1f
Merge branch 'main' into fix/relation-mysql-below-8
2022-11-16 15:26:47 +01:00
Jamie Howard
04295573f1
chore(entity-manager): revert to not handle multiple pg schemas
2022-11-16 11:22:22 +00:00
Pierre Noël
5e5d1c92c2
use getDatabaseInformation instead of databaseInformation
2022-11-16 10:58:28 +01:00
Jamie Howard
4b1f8101e6
fix(entity-manager): use db.connection for .raw()
...
chore(database): revert getConnection()
2022-11-16 09:34:08 +00:00
Pierre Noël
306d5c4abc
finally drop temp table
2022-11-15 18:57:13 +01:00
Pierre Noël
e2234ed9f1
use connection instead of getConnection
2022-11-15 18:42:18 +01:00
Pierre Noël
887ea1ae59
Avoid use of window functions for MySQL versions below 8
2022-11-15 16:43:04 +01:00
Jamie Howard
5553538c18
chore
2022-11-15 13:37:18 +00:00
Jamie Howard
0f7eb70fd2
fix(database): refactor getConnection to not use schemas
2022-11-15 13:28:35 +00:00
Jamie Howard
cad6a8da1c
fix(entity-manager): knex withSchema.raw error
2022-11-14 16:39:57 +00:00
Pierre Noël
05c93d44c5
add content api tests for connect relation format
2022-10-24 11:09:01 +02:00
Pierre Noël
6e67d82f5f
add transaction in DB entity manager
2022-10-06 18:03:10 +02:00
Pierre Noël
bf16d07463
throw when deletePreviousAnyToOneRelations and deletePreviousOneToAnyRelations are called for non compatible relations
2022-09-30 10:54:43 +02:00
Pierre Noël
8248458a1f
fix cleanOrder query for mysql
2022-09-30 10:54:43 +02:00
Pierre Noël
8e5543b21d
fix cleanOrder + use hasOrderColumn and hasInverseOrderColumn
2022-09-30 10:54:41 +02:00
Pierre Noël
a56879e12b
implement cleanOrder function
2022-09-30 10:54:41 +02:00
Pierre Noël
a9819dc375
use onConflict in updateRelations
2022-09-30 10:54:38 +02:00
Pierre Noël
3b0d6b6e7f
refactor deleteAllRelations
2022-09-30 10:54:37 +02:00