Releases: drizzle-team/drizzle-kit-mirror
0.19.13
-
🐛 Generated SQL try to drop constrains on the wrong table name when renaming
-
🐛 Removed a few unused imports from introspection in PostgreSQL
-
🐛 BUG: drizzle-kit introspect:mysql tables with pk and unique keys
-
🐛 Cannot generate type for array of enum in postgres when introspecting
-
✍️ Change default host for Drizzle Studio to 0.0.0.0 and allow to specify other host values
0.19.12
- 🐛 SQLite
push
changes were triggered if there is an{ autoincrement: true }
field in a schema. This was caused by SQLite not storing proper information about theAUTOINCREMENT
property for the column. In this release, it should treat it as expected. - 🐛 The SQLite
introspect
command was generating incorrect defaults for expressions in the output schema. - 🐛 As long as SQLite creates indexes for primary keys by default, those were not filtered in the push command. In this release, we will ignore such indexes.
- 🐛 Fixed MySQL - Introspect not importing int
0.19.11
- 🐛 Postgres introspect relation does not exist
- 🐛 [email protected] Regression
- 🐛 In MySQL
DROP PK
+ADD PK
statements were showing up forpush:mysql
command even if nothing was changed in a schema
0.19.10
0.19.8
0.19.7
A few more important bug fixes for MySQL:
-
🐛 Adding
NOT NULL
andDEFAULT 0
for integer columns was triggering table truncation on push. I askeddrizzle-kit
not to do it, and he agreed. -
🐛
__drizzle_migrations
was used for primary key detection during introspection. For now, we will simply filter this table during the information schema querying step. -
🐛 Another attempt to fix
Impossible to push schema changes due to ER_DROP_INDEX_FK
. When pushing and introspecting on MySQL,drizzle-kit
was taking all indexes from a database. However, it appears that MySQL automatically creates an index for foreign keys (https://dev.mysql.com/doc/refman/8.0/en/constraint-foreign-key.html)
As long as you, as a user, do not specify this index in the schema,drizzle-kit
will be triggered by changes and attempt todrop index
. In this patch release, we have decided to ignore such indexes and add collision checks for the same name of foreign key constraints and indexes in the same table. -
🐛 MySQL defaults with
sql
inside were mapped incorrectly, which caused constant schema changes duringpush
. We have made changes to the way generated defaults are handled in the code, so now it should work properly. -
✍️ Added a new collision check between indexes and foreign key constraints with the same name in the same table. Finally, drizzle-kit's collision checks are expanding. We have included some documentation and blog post links for anyone interested in understanding how databases work for specific cases
0.19.6
n this issue, there were two problems with MySQL migration generation and schema pushing:
-
MySQL, like SQLite, does not have a difference in unique constraints and unique indexes at the database level. This aspect was handled correctly for SQLite but not for MySQL. In MySQL, when a
unique index
is created from a Drizzle schema, it is stored as both a unique constraint and a unique index in the database. Therefore, there was no distinction between the two. This led to incorrect assumptions during schema pushes regarding the creation, dropping, or storage of unique indexes. In the current fixes, Drizzle Kit now treats unique constraints as unique indexes for MySQL and SQLite only. -
Drizzle Kit was attempting to drop the primary key when it shouldn't have done so. The issue was with incorrect querying of the information schema. Drizzle Kit was examining the column definition and the
column_key
setting from theinformation_schema.columns table
. However, it turns out that thecolumn_key
value can indicatePRIMARY
even for columns that are bothUNIQUE
andNOT_NULL
. Which is correct in database terms, but not valid in the determination if this constraint was created as Primary Key.
I have made changes to address this problem by utilizing the information_schema.table_constraints
table, which provides a proper distinction between primary keys and columns with the combination of UNIQUE
and NOT_NULL
- ✍️ Added new collision check between the same names in unique indexes and unique constraints in schema(for MySQL)
0.19.5
- 🐛 drizzle-kit: v0.19.4 generates ,, - thanks @agotfredsen82
- 🐛 Wrong syntax for MySQL composite primary key - thanks @AlessioDP
- 🐛 introspect:sqlite generates invalid schema for text columns - thanks @ninxadev
- 🐛 push:sqlite does not recognize --schema option - thanks @WPitak
- 🐛 generate:sqlite generates invalid migration statement for integer field that use auto-increment - thanks @WPitak
0.19.4
🎉 Added support for UNIQUE constraints in PostgreSQL, MySQL, SQLite
Drizzle Kit now properly handles unique constraints for each dialect. In PostgreSQL and MySQL, they will be created as UNIQUE constraints, while in SQLite, they will be created as UNIQUE INDEX statements. According to the SQLite documentation, unique constraints are treated as unique indexes. Therefore, in the ORM and Kit, we handle unique constraints for SQLite as unique indexes
🎉 Collision detection for unique keys
We are introducing collision detection for unique keys as part of the new wave of drizzle-kit improvements. Currently, if drizzle-kit finds any unique constraints with the same name, you will receive a warning and identify the places where those names were defined by mistake. In the upcoming releases, we will further enhance this feature by adding collision checks for column names, other constraints, and more collisions and database-specific limitations.
0.19.3
Drizzle Studio
New cli command is available drizzle-kit studio
Drizzle Studio is a helper for data visualization. It seamlessly integrates with your existing data infrastructure by reading the drizzle.config
file and establishing a connection to your specified database. Studio supports all drivers, including pg
, mysql2
, better-sqlite
, libsql
, and even turso
driver!
Available actions
- Retrieve a list of all tables in the schema.
- Obtain the row count for each table.
- Perform table selection with options such as limit, offset, filters, and partial select.
- View all relations defined by the
Relational Queries
utility. - Create, update, and delete entities from tables.
- Benefit from basic type validation.
Available cli options
--port=3000
- By default, Drizzle will use port4983
, but you can specify any port you desire--verbose
- With this flag, you can print all statements that Drizzle Studio will execute while you browse through your data
For more information please check: https://driz.li/meet-studio
Improvements Roadmap
- Enhance validations with helpers such as datepicker, JSON validation, and more.
- Expand the range of filter options available.
- Introduce a schema change listener.
- And much more!
Bug fixes
- Correct the wrong typing option for SQLite
generate
andpush
commands when using autoincrement. - Address the SQLite
push
issue that generates incorrect defaults for booleans. - Resolve the SQLite
push
issue where unnecessary migrations are generated for composite primary keys.