drizzle-kit 0.18.0-a7a8954 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -5
- package/package.json +1 -1
- package/readme.md +14 -1
package/index.js
CHANGED
|
@@ -51042,6 +51042,7 @@ var logSuggestionsAndReturn = async ({
|
|
|
51042
51042
|
};
|
|
51043
51043
|
|
|
51044
51044
|
// src/cli/index.ts
|
|
51045
|
+
init_serializer();
|
|
51045
51046
|
var printVersions = () => {
|
|
51046
51047
|
console.log(`${source_default.gray(versions())}
|
|
51047
51048
|
`);
|
|
@@ -51120,6 +51121,11 @@ var dbPushMysqlCommand = new Command("push:mysql").option(
|
|
|
51120
51121
|
assertOrmCoreVersion();
|
|
51121
51122
|
const { mysqlPushIntrospect: mysqlPushIntrospect2, connectToMySQL: connectToMySQL2 } = (init_mysqlIntrospect(), __toCommonJS(mysqlIntrospect_exports));
|
|
51122
51123
|
const drizzleConfig = drizzleConfigFromFile(options.config);
|
|
51124
|
+
const fileNames = prepareFilenames(drizzleConfig.schema);
|
|
51125
|
+
if (fileNames.length === 0) {
|
|
51126
|
+
(0, import_hanji6.render)(`[${source_default.blue("i")}] No schema file in ${drizzleConfig.schema} was found`);
|
|
51127
|
+
process.exit(0);
|
|
51128
|
+
}
|
|
51123
51129
|
const connection = await connectToMySQL2(drizzleConfig);
|
|
51124
51130
|
const filterConfig = drizzleConfig.tablesFilter;
|
|
51125
51131
|
const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
|
|
@@ -51152,11 +51158,7 @@ var dbPushMysqlCommand = new Command("push:mysql").option(
|
|
|
51152
51158
|
"THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED\n"
|
|
51153
51159
|
)
|
|
51154
51160
|
);
|
|
51155
|
-
console.log(
|
|
51156
|
-
source_default.white(
|
|
51157
|
-
"Do you still want to push changes?"
|
|
51158
|
-
)
|
|
51159
|
-
);
|
|
51161
|
+
console.log(source_default.white("Do you still want to push changes?"));
|
|
51160
51162
|
const { status, data } = await (0, import_hanji6.render)(
|
|
51161
51163
|
new Select([
|
|
51162
51164
|
"No, abort",
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
DrizzleKit - is a CLI migrator tool for DrizzleORM. It is probably 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
|
+
## Documentation
|
|
7
|
+
|
|
8
|
+
Check the full documenation on [the website](https://orm.drizzle.team/kit-docs/overview)
|
|
9
|
+
|
|
6
10
|
### How it works
|
|
7
11
|
|
|
8
12
|
`drizzle-kit` will traverse `schema folder` or `schema file`, generate schema snapshot and compare it to the previous version, if there's one.
|
|
@@ -61,8 +65,17 @@ npm install -D drizzle-kit
|
|
|
61
65
|
|
|
62
66
|
Running with CLI options
|
|
63
67
|
|
|
68
|
+
```jsonc
|
|
69
|
+
// package.json
|
|
70
|
+
{
|
|
71
|
+
"scripts": {
|
|
72
|
+
"generate": "drizzle-kit generate:pg --out migrations-folder --schema src/db/schema.ts"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
64
77
|
```shell
|
|
65
|
-
|
|
78
|
+
npm run generate
|
|
66
79
|
```
|
|
67
80
|
|
|
68
81
|
### Configuration
|