0.18.0
[email protected] πππ
New features π
New ways to define drizzle config file
You can now specify the configuration not only in the .json
format but also in .ts
and .js
formats.
TypeScript example
import { Config } from "src";
export default {
schema: "",
connectionString: process.env.DB_URL,
out: "",
breakpoints: true
} satisfies Config;
JavaScript example
/** @type { import("drizzle-kit").Config } */
export default {
schema: "",
connectionString: "",
out: "",
breakpoints: true
};
New commands π
drizzle-kit push:mysql
You can now push your MySQL schema directly to the database without the need to create and manage migration files. This feature proves to be particularly useful for rapid local development and when working with PlanetScale databases.
By pushing the MySQL schema directly to the database, you can streamline the development process and avoid the overhead of managing migration files. This allows for more efficient iteration and quick deployment of schema changes during local development.
How to setup your codebase for drizzle-kit push feature?
-
For this feature, you need to create a
drizzle.config.[ts|js|json]
file. We recommend using.ts
or.js
files as they allow you to easily provide the database connection information as secret variablesYou'll need to specify
schema
andconnectionString
(ordb
,port
,host
,password
, etc.) to makedrizzle-kit push:mysql
work
drizzle.config.ts
example
import { Config } from "src";
export default {
schema: "./schema.ts",
connectionString: process.env.DB_URL,
} satisfies Config;
-
Run
drizzle-kit push:mysql
-
If Drizzle detects any potential
data-loss
issues during a migration, it will prompt you to approve whether the data should be truncated or not in order to ensure a successful migration -
Approve or reject the action that Drizzle needs to perform in order to push your schema changes to the database.
-
Done β