drizzle-kit 0.28.0 → 0.28.1-375ed28
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -7
- package/api.js +1032 -710
- package/api.mjs +1032 -710
- package/bin.cjs +644 -49
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
## Drizzle Kit
|
2
2
|
|
3
|
-
|
3
|
+
Drizzle Kit is a CLI migrator tool for Drizzle ORM. It is probably the one and only tool that lets you completely automatically generate SQL migrations and covers ~95% of the common cases like deletions and renames by prompting user input.
|
4
4
|
<https://github.com/drizzle-team/drizzle-kit-mirror> - is a mirror repository for issues.
|
5
5
|
|
6
6
|
## Documentation
|
7
7
|
|
8
|
-
Check the full
|
8
|
+
Check the full documentation on [the website](https://orm.drizzle.team/kit-docs/overview).
|
9
9
|
|
10
10
|
### How it works
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
Drizzle Kit traverses a schema module and generates a snapshot to compare with the previous version, if there is one.
|
13
|
+
Based on the difference, it will generate all needed SQL migrations. If there are any cases that can't be resolved automatically, such as renames, it will prompt the user for input.
|
14
14
|
|
15
|
-
For schema
|
15
|
+
For example, for this schema module:
|
16
16
|
|
17
17
|
```typescript
|
18
|
-
//
|
18
|
+
// src/db/schema.ts
|
19
19
|
|
20
20
|
import { integer, pgTable, serial, text, varchar } from "drizzle-orm/pg-core";
|
21
21
|
|
@@ -63,7 +63,7 @@ CREATE INDEX IF NOT EXISTS users_full_name_index ON users (full_name);
|
|
63
63
|
npm install -D drizzle-kit
|
64
64
|
```
|
65
65
|
|
66
|
-
Running with CLI options
|
66
|
+
Running with CLI options:
|
67
67
|
|
68
68
|
```jsonc
|
69
69
|
// package.json
|