Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Releases: drizzle-team/drizzle-kit-mirror

0.19.13

18 Aug 11:17
edfae9e
Compare
Choose a tag to compare

0.19.12

26 Jul 15:20
edfae9e
Compare
Choose a tag to compare
  • 🐛 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 the AUTOINCREMENT 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

24 Jul 20:52
edfae9e
Compare
Choose a tag to compare

0.19.10

20 Jul 18:12
edfae9e
Compare
Choose a tag to compare

Drizzle Studio updates

  • 🎉 Drizzle Studio now has the possibility to export the whole table or selected rows to a json or csv
Screenshot 2023-07-20 at 21 01 23

0.19.8

17 Jul 19:50
edfae9e
Compare
Choose a tag to compare

Drizzle Kit

Bug fixes

  • 🐛 Cannot read properties of undefined (reading 'columns') on push:mysql with tableFilters

Drizzle Studio

Bug fixes

Features

  • 🎉 Added a new shortcuts option. You can now navigate, close, and open specific tables using shortcuts
image image

0.19.7

17 Jul 18:09
edfae9e
Compare
Choose a tag to compare

A few more important bug fixes for MySQL:

  • 🐛 Adding NOT NULL and DEFAULT 0 for integer columns was triggering table truncation on push. I asked drizzle-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 to drop 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 during push. 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

16 Jul 19:18
edfae9e
Compare
Choose a tag to compare

n this issue, there were two problems with MySQL migration generation and schema pushing:

  1. 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.

  2. 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 the information_schema.columns table. However, it turns out that the column_key value can indicate PRIMARY even for columns that are both UNIQUE and NOT_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

12 Jul 20:25
edfae9e
Compare
Choose a tag to compare

0.19.4

11 Jul 22:10
edfae9e
Compare
Choose a tag to compare

🎉 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.

image

0.19.3

01 Jul 18:28
edfae9e
Compare
Choose a tag to compare

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

  1. Retrieve a list of all tables in the schema.
  2. Obtain the row count for each table.
  3. Perform table selection with options such as limit, offset, filters, and partial select.
  4. View all relations defined by the Relational Queries utility.
  5. Create, update, and delete entities from tables.
  6. Benefit from basic type validation.

Available cli options

  1. --port=3000 - By default, Drizzle will use port 4983, but you can specify any port you desire
  2. --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

  1. Enhance validations with helpers such as datepicker, JSON validation, and more.
  2. Expand the range of filter options available.
  3. Introduce a schema change listener.
  4. And much more!

Bug fixes

  1. Correct the wrong typing option for SQLite generate and push commands when using autoincrement.
  2. Address the SQLite push issue that generates incorrect defaults for booleans.
  3. Resolve the SQLite push issue where unnecessary migrations are generated for composite primary keys.