@netlify/agent-runner-cli 1.145.0 → 1.147.0-trace.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/dist/bin-local.js +180 -203
- package/dist/bin.js +252 -275
- package/dist/index.js +164 -187
- package/dist/skills/netlify-database/SKILL.md +7 -4
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ adding indexes, etc.) will only work if a corresponding migration exists in `net
|
|
|
33
33
|
migration, the database schema will not change and the application will break at runtime.
|
|
34
34
|
|
|
35
35
|
This applies regardless of whether you are using Drizzle ORM or the native `@netlify/database` driver:
|
|
36
|
-
- **With Drizzle ORM**: Update the schema definition, then run `npx drizzle-kit generate
|
|
36
|
+
- **With Drizzle ORM**: Update the schema definition, then run `npx drizzle-kit generate --name <descriptive_name>`
|
|
37
37
|
- **With native driver**: Write a new SQL migration file in `netlify/database/migrations/`
|
|
38
38
|
|
|
39
39
|
Never consider a schema change complete without a corresponding migration file.
|
|
@@ -113,12 +113,15 @@ export default defineConfig({
|
|
|
113
113
|
|
|
114
114
|
### Step 5: Generate migrations
|
|
115
115
|
|
|
116
|
-
Every time you change the schema, run `drizzle-kit generate
|
|
116
|
+
Every time you change the schema, run `drizzle-kit generate` with a `--name` describing the change
|
|
117
|
+
(max 50 characters, snake_case, starting with an imperative verb like add, create, drop, alter, rename, index):
|
|
117
118
|
|
|
118
119
|
```bash
|
|
119
|
-
npx drizzle-kit generate
|
|
120
|
+
npx drizzle-kit generate --name add_users_bio
|
|
120
121
|
```
|
|
121
122
|
|
|
123
|
+
Without `--name`, drizzle-kit assigns a random two-word name that says nothing about the migration.
|
|
124
|
+
|
|
122
125
|
This creates SQL migration files in `netlify/database/migrations/`.
|
|
123
126
|
|
|
124
127
|
### Step 6: Use the database in functions
|
|
@@ -354,7 +357,7 @@ applied to the database yet.
|
|
|
354
357
|
as immutable. Roll forward with a new migration that applies the correction. This is always safe.
|
|
355
358
|
- If a migration is **not yet applied** anywhere (it's only on disk), don't edit it in place. Run
|
|
356
359
|
`netlify db migrations reset` to delete it, update `db/schema.ts` to reflect your new intent, then run
|
|
357
|
-
`npx drizzle-kit generate
|
|
360
|
+
`npx drizzle-kit generate --name <descriptive_name>` to produce a fresh migration. Editing SQL or snapshot files directly can
|
|
358
361
|
desync Drizzle Kit's internal state and produce broken migrations on the next generate.
|
|
359
362
|
|
|
360
363
|
### `netlify db migrations reset` — cleaning up unapplied migrations
|