You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -241,6 +241,20 @@ export async function down(DB) {
241
241
}
242
242
```
243
243
244
+
You may generate new migration files in ESM syntax by passing the `--esm` flag to the `ley new` command:
245
+
246
+
```sh
247
+
$ ley new todos --esm
248
+
#=> migrations/003-todos.mjs
249
+
250
+
$ cat migrations/003-todos.mjs
251
+
#=> export async function up(client) {
252
+
#=> }
253
+
#=>
254
+
#=> export async function down(client) {
255
+
#=> }
256
+
```
257
+
244
258
## Drivers
245
259
246
260
Out of the box, `ley` includes drivers for the following npm packages:
@@ -339,7 +353,15 @@ Type: `string`
339
353
340
354
**Required.** The name of the file to be created.
341
355
342
-
>**Note:**A prefix will be prepended based on [`opts.timestamp`](#optstimestamp) and [`opts.length`](#optslength) values.<br>The `.js` extension will be applied unless your input already has an extension.
356
+
>**Note:**A prefix will be prepended based on [`opts.timestamp`](#optstimestamp) and [`opts.length`](#optslength) values.<br>If your input does not already end with an extension, then `.js` or `.mjs` will be appended.
357
+
358
+
#### opts.esm
359
+
Type:`boolean`<br>
360
+
Default:`false`
361
+
362
+
Create a migration file withESM syntax.
363
+
364
+
>**Note:** When true, the `opts.filename` will contain the `.mjs` file extension unless your input already has an extension.
0 commit comments