Skip to content

Commit c0003d0

Browse files
committed
Adding a note about binding name vs database name
for D1 bindings.
1 parent 88316c8 commit c0003d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/content/docs/d1/reference/migrations.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Currently, the migrations system aims to be simple yet effective. With the curre
2020

2121
Every migration file in the `migrations` folder has a specified version number in the filename. Files are listed in sequential order. Every migration file is an SQL file where you can specify queries to be run.
2222

23+
:::note[Binding name vs Database name]
24+
When running a migration script, you can use either the binding name or the database name.
25+
26+
However, the binding name can change, whereas the database name cannot. Therefore, to avoid accidentally running migrations on the wrong binding, you may wish to use the database name for D1 migrations.
27+
:::
28+
2329
## Wrangler customizations
2430

2531
By default, migrations are created in the `migrations/` folder in your Worker project directory. Creating migrations will keep a record of applied migrations in the `d1_migrations` table found in your database.

0 commit comments

Comments
 (0)