Skip to content

Commit 955db1e

Browse files
committed
Adding note about when to run the optional
migration step.
1 parent 0517e7b commit 955db1e

File tree

2 files changed

+17
-9
lines changed
  • src/content/docs/hyperdrive/examples

2 files changed

+17
-9
lines changed

src/content/docs/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/drizzle-orm.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@ export default {
9797
} satisfies ExportedHandler<Env>;
9898
```
9999

100-
If your database is empty, continue to step [2.3. Configure Drizzle-Kit for migration](/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/drizzle-orm/#23-configure-drizzle-kit-for-migrations-optional).
101-
102100
### 2.3. Configure Drizzle-Kit for migrations (optional)
103101

102+
:::note
103+
You need to set up the tables in your database so that Drizzle ORM can make queries that work.
104+
105+
If you have already set it up (for example, if another user has applied the schema to your database), or if you are starting to use Drizzle ORM and the schema matches what already exists in your database, then you do not need to run the migration.
106+
:::
107+
104108
You can generate and run SQL migrations on your database based on your schema using Drizzle Kit CLI. Refer to [Drizzle ORM docs](https://orm.drizzle.team/docs/get-started/mysql-new) for additional guidance.
105109

106110
<Steps>
@@ -134,9 +138,9 @@ You can generate and run SQL migrations on your database based on your schema us
134138
```
135139
```bash output
136140
No config path provided, using default 'drizzle.config.ts'
137-
Reading config file '/Users/junlee/tutorials/jun-hyperdrive-drizzle-mysql/drizzle.config.ts'
141+
Reading config file 'drizzle.config.ts'
138142
Reading schema files:
139-
/Users/junlee/tutorials/jun-hyperdrive-drizzle-mysql/src/db/schema.ts
143+
/src/db/schema.ts
140144

141145
1 tables
142146
users 4 columns 0 indexes 0 fks
@@ -148,7 +152,7 @@ You can generate and run SQL migrations on your database based on your schema us
148152
```
149153
```bash output
150154
No config path provided, using default 'drizzle.config.ts'
151-
Reading config file '/Users/junlee/tutorials/jun-hyperdrive-drizzle-mysql/drizzle.config.ts'
155+
Reading config file 'drizzle.config.ts'
152156
```
153157
</Steps>
154158

src/content/docs/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/drizzle-orm.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ You may use [node-postgres](https://orm.drizzle.team/docs/get-started-postgresql
100100
when using Drizzle ORM. Both are supported and compatible.
101101
:::
102102

103-
If your database is empty, continue to step [2.3. Configure Drizzle-Kit for migration](/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/drizzle-orm/#23-configure-drizzle-kit-for-migrations-optional).
104-
105103
### 2.3. Configure Drizzle-Kit for migrations (optional)
106104

105+
:::note
106+
You need to set up the tables in your database so that Drizzle ORM can make queries that work.
107+
108+
If you have already set it up (for example, if another user has applied the schema to your database), or if you are starting to use Drizzle ORM and the schema matches what already exists in your database, then you do not need to run the migration.
109+
:::
110+
107111
You can generate and run SQL migrations on your database based on your schema using Drizzle Kit CLI. Refer to [Drizzle ORM docs](https://orm.drizzle.team/docs/get-started/postgresql-new) for additional guidance.
108112

109113
<Steps>
@@ -140,7 +144,7 @@ You can generate and run SQL migrations on your database based on your schema us
140144
```
141145
```bash output
142146
No config path provided, using default 'drizzle.config.ts'
143-
Reading config file '/Users/junlee/tutorials/jun-hyperdrive-drizzle/drizzle.config.ts'
147+
Reading config file 'drizzle.config.ts'
144148
1 tables
145149
users 4 columns 0 indexes 0 fks
146150

@@ -152,7 +156,7 @@ You can generate and run SQL migrations on your database based on your schema us
152156
```
153157
```bash output
154158
No config path provided, using default 'drizzle.config.ts'
155-
Reading config file '/Users/junlee/tutorials/jun-hyperdrive-drizzle/drizzle.config.ts'
159+
Reading config file 'drizzle.config.ts'
156160
Using 'postgres' driver for database querying
157161
```
158162
</Steps>

0 commit comments

Comments
 (0)