A modular Deno library for PostgreSQL, MySQL, MariaDB and SQLite migrations
### Operating System macOS Monterey 12.0.1 ### Deno version deno 1.15.3 ### Nessie version 2.0.4 ### Bug description I'm trying to run my first migration, but it keeps throwing the following error: ```zsh deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate INFO connecting 127.0.0.1:3306 INFO connected to 127.0.0.1:3306 Starting migration of 1 files ---- Migrating 20211104194910_make_users.ts Check file:///Users/user/projects/nessie/db/migrations/20211104194910_make_users.ts TypeError: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'. Type 'URL' is not assignable to type 'string'. return new URL(url).pathname ~~~ at https://deno.land/x/[email protected]/lib/deps/path/win32.ts:911:18 TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'. Type 'URL' is not assignable to type 'string'. return new URL(url).pathname; ~~~ at https://deno.land/x/[email protected]/lib/deps/path/posix.ts:433:18 Found 2 errors. at async ClientMySQL._migrationHandler (https://deno.land/x/[email protected]/clients/AbstractClient.ts:243:37) at async ClientMySQL._migrate (https://deno.land/x/[email protected]/clients/AbstractClient.ts:100:7) at async ClientMySQL.migrate (https://deno.land/x/[email protected]/clients/ClientMySQL.ts:105:5) at async Command.migrate [as fn] (https://deno.land/x/[email protected]/cli.ts:249:3) at async Command.execute (https://deno.land/x/[email protected]/command/command.ts:1010:7) at async Command.parse (https://deno.land/x/[email protected]/command/command.ts:928:16) at async cli (https://deno.land/x/[email protected]/cli.ts:51:3) at async run (https://deno.land/x/[email protected]/cli.ts:368:5) at async https://deno.land/x/[email protected]/cli.ts:387:1 This error is most likely unrelated to Nessie, and is probably related to the client, the connection config or the query you are trying to execute. ``` The migration file: ```typescript import { AbstractMigration, ClientMySQL, Info, } from "https://deno.land/x/[email protected]/mod.ts"; import Dex from "https://deno.land/x/[email protected]/mod.ts"; export default class extends AbstractMigration<ClientMySQL> { async up({ dialect }: Info): Promise<void> { const query = Dex({ client: dialect }).schema.createTable( 'users', (table: any) => { table.increments("id").primary(); table.string("firstName"); table.string("lastName"); table.string("email"); table.string("password"); table.timestamps(null, true); }, ); await this.client.query(query); } async down({ dialect }: Info): Promise<void> { const query = Dex({ client: dialect }).schema.dropTable('users'); await this.client.query(query); } } ``` ### Steps to reproduce 1. Run `deno run -A --unstable https://deno.land/x/nessie/cli.ts make:migration make_users` 2. Past the content of the migration file mentioned above. 3. Run `deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate` ### Aditional information ```zsh deno --version deno 1.15.3 (release, x86_64-apple-darwin) v8 9.5.172.19 typescript 4.4.2 ``` mysql 8.0.25_1 Installed with Homebrew
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by Klumper and has received 2 comments.