thibaultk
thibaultk

Reputation: 33

'RelativeUrlWithoutBase' while migrating tables using SeaORM

I've been recently putting my head into using SeaORM. So I'm currently walking through the tutorial with relative ease.

However, I am stuck on Chapter 1.2 (Migration CLI). The main code runs fine, I managed to create a MySQL database on PhpMyAdmin (with WAMPServer). But, as soon as it comes to migrating tables through sea-orm-cli migrate refresh, I get hit with this error:

Fail to parse database URL: RelativeUrlWithoutBase
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: process didn't exit successfully: migration\target\debug\migration.exe refresh -u DATABASE_URL=mysql://root:@localhost:3306/bakeries_db (exit code: 101)
Fail to run migration

FYI, I am using the exact same migration files, along with their names.

My .env file (at the root of the project, which is where I run the sea-orm-cli command) only has this line:

DATABASE_URL="DATABASE_URL=mysql://root:@localhost:3306/bakeries_db"

I am struggling to understand why is it going this way. I've tried to change the DATABASE_URL by removing the "DATABASE_URL=" before the actual URL, thinking it might have to do with redundancy. But this time, the output is different:

Execution Error: error returned from database: 1071 (42000): Specified key was too long. Max key length is 1000 bytes
error: process didn't exit successfully: migration\target\debug\migration.exe refresh -u mysql://root:@localhost:3306/bakeries_db (exit code: 1)
Fail to run migration

Can anyone help me out? I'd greatly appreciate it! :)

Upvotes: -1

Views: 18

Answers (0)

Related Questions