You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Fixed [Composite primary key order is not consistent](https://github.com/drizzle-team/drizzle-kit-mirror/issues/342) by removing `sort` in SQLite and to be consistant with the same logic in PostgreSQL and MySQL
4
+
5
+
The issue that may arise for SQLite users with any driver using composite primary keys is that the order in the database may differ from the Drizzle schema.
6
+
7
+
- If you are using `push`, you **MAY** be prompted to update your table with a new order of columns in the composite primary key. You will need to either change it manually in the database or push the changes, but this may lead to data loss, etc.
8
+
9
+
- If you are using `generate`, you **MAY** also be prompted to update your table with a new order of columns in the composite primary key. You can either keep that migration or skip it by emptying the SQL migration file.
10
+
11
+
If nothing works for you and you are blocked, please reach out to me @AndriiSherman. I will try to help you!
12
+
13
+
14
+
## Bug fixes
15
+
16
+
-[[BUG] When using double type columns, import is not inserted](https://github.com/drizzle-team/drizzle-kit-mirror/issues/403) - thanks @Karibash
17
+
-[[BUG] A number value is specified as the default for a column of type char](https://github.com/drizzle-team/drizzle-kit-mirror/issues/404) - thanks @Karibash
18
+
-[[BUG]: Array default in migrations are wrong](https://github.com/drizzle-team/drizzle-orm/issues/2621) - thanks @L-Mario564
-[[BUG]: drizzle-kit generate succeeds but generates invalid SQL for default([]) - Postgres](https://github.com/drizzle-team/drizzle-orm/issues/2432) - thanks @L-Mario564
21
+
-[[BUG]: Incorrect type for array column default value](https://github.com/drizzle-team/drizzle-orm/issues/2334) - thanks @L-Mario564
22
+
-[[BUG]: error: column is of type integer[] but default expression is of type integer](https://github.com/drizzle-team/drizzle-orm/issues/2224) - thanks @L-Mario564
23
+
-[[BUG]: Default value in array generating wrong migration file](https://github.com/drizzle-team/drizzle-orm/issues/1003) - thanks @L-Mario564
24
+
-[[BUG]: enum as array, not possible?](https://github.com/drizzle-team/drizzle-orm/issues/1564) - thanks @L-Mario564
## Breaking changes (for some of postgres.js users)
2
+
3
+
#### Bugs fixed for this breaking change
4
+
5
+
-[Open
6
+
[BUG]: jsonb always inserted as a json string when using postgres-js](https://github.com/drizzle-team/drizzle-orm/issues/724)
7
+
-[[BUG]: jsonb type on postgres implement incorrectly](https://github.com/drizzle-team/drizzle-orm/issues/1511)
8
+
9
+
If you were using `postgres-js` with `jsonb` fields, you might have seen stringified objects in your database, while drizzle insert and select operations were working as expected.
10
+
11
+
You need to convert those fields from strings to actual JSON objects. To do this, you can use the following query to update your database:
12
+
13
+
**if you are using jsonb:**
14
+
```sql
15
+
update table_name
16
+
set jsonb_column = (jsonb_column #>> '{}')::jsonb;
17
+
```
18
+
19
+
**if you are using json:**
20
+
```sql
21
+
update table_name
22
+
set json_column = (json_column #>> '{}')::json;
23
+
```
24
+
25
+
We've tested it in several cases, and it worked well, but only if all stringified objects are arrays or objects. If you have primitives like strings, numbers, booleans, etc., you can use this query to update all the fields
26
+
27
+
**if you are using jsonb:**
28
+
```sql
29
+
UPDATE table_name
30
+
SET jsonb_column = CASE
31
+
-- Convert to JSONB if it is a valid JSON object or array
32
+
WHEN jsonb_column #>> '{}' LIKE '{%' OR jsonb_column #>> '{}' LIKE '[%' THEN
33
+
(jsonb_column #>> '{}')::jsonb
34
+
ELSE
35
+
jsonb_column
36
+
END
37
+
WHERE
38
+
jsonb_column IS NOT NULL;
39
+
```
40
+
41
+
**if you are using json:**
42
+
```sql
43
+
UPDATE table_name
44
+
SET json_column = CASE
45
+
-- Convert to JSON if it is a valid JSON object or array
46
+
WHEN json_column #>> '{}' LIKE '{%' OR json_column #>> '{}' LIKE '[%' THEN
47
+
(json_column #>> '{}')::json
48
+
ELSE
49
+
json_column
50
+
END
51
+
WHERE json_column IS NOT NULL;
52
+
```
53
+
54
+
If nothing works for you and you are blocked, please reach out to me @AndriiSherman. I will try to help you!
55
+
56
+
## Bug Fixes
57
+
58
+
-[[BUG]: boolean mode not working with prepared statements (bettersqlite)](https://github.com/drizzle-team/drizzle-orm/issues/2568) - thanks @veloii
59
+
-[[BUG]: isTable helper function is not working](https://github.com/drizzle-team/drizzle-orm/issues/2672) - thanks @hajek-raven
60
+
-[[BUG]: Documentation is outdated on inArray and notInArray Methods](https://github.com/drizzle-team/drizzle-orm/issues/2690) - thanks @RemiPeruto
0 commit comments