Typeorm migration run
definewater
HOBBYOP

2 years ago

    "start": "sleep 3 && tsc && pnpm run sync && pnpm run migrate:run && node ./build/index.js",
    "sync": "pnpm typeorm migration:generate /app/build/migration/Init -o -d /app/build/data-source.js",
    "migrate:run": "pnpm typeorm migration:run -d /app/build/data-source.js",
    "typeorm": "npx typeorm-ts-node-commonjs",
    "sentry:sourcemaps": "sentry-cli sourcemaps inject --org define-waters --project node-express ./build && sentry-cli sourcemaps upload --org define-waters --project node-express ./build"

hey guys i hvae this issue with when my migrations are being synced/generated it some how fails and wont run due to there no migration being generated ( which is okay, dont make if cant find ) but for some reason when it hits the migration:run the app starts over from zero again -.-

33 Replies

definewater
HOBBYOP

2 years ago

51cb3e5e-013d-43eb-b545-600daa26b09f



definewater
HOBBYOP

2 years ago


definewater
HOBBYOP

2 years ago

No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command`

definewater
HOBBYOP

2 years ago

this is the eye catchin part ^^


definewater
HOBBYOP

2 years ago

also this


definewater
HOBBYOP

2 years ago

INFO: All classes found using provided glob pattern "/app/build/entity/*.js" : "/app/build/entity/Addresser.js,/app/build/entity/Admin.js,/app/build/entity/BookeableItem.js,/app/build/entity/Bookings.js,/app/build/entity/Category.js,/app/build/entity/CategoryItem.js,/app/build/entity/CouponCode.js,/app/build/entity/CouponItem.js,/app/build/entity/Coupons.js,/app/build/entity/Order.js,/app/build/entity/Reciepts.js,/app/build/entity/ServiceBookable.js,/app/build/entity/ServiceBooking.js,/app/build/entity/Users.js"

INFO: No classes were found using the provided glob pattern:  "/app/build/migration/*.js"

definewater
HOBBYOP

2 years ago

it finds the entites no problem but then ofc no migrations are suppose to be found since it up to date which is fine


2 years ago

change the && after the migration command to a semicolon


definewater
HOBBYOP

2 years ago

```pnpm run sync, pnpm run migrate:run ````


definewater
HOBBYOP

2 years ago

like this?


2 years ago

that's not a semicolon


definewater
HOBBYOP

2 years ago

sorry ahhahahaahah


definewater
HOBBYOP

2 years ago

"start": "sleep 3 && tsc && pnpm run sync; pnpm run migrate:run && pnpm sentry:sourcemaps && node ./build/index.js",


definewater
HOBBYOP

2 years ago

OH AFTER


definewater
HOBBYOP

2 years ago

sorry


2 years ago

yep


definewater
HOBBYOP

2 years ago

"start": "sleep 3 && tsc && pnpm run sync && pnpm run migrate:run; pnpm sentry:sourcemaps && node ./build/index.js",

2 years ago

that's just a quick work around, the correct solution would be to have the migration command exit with 0 if there are no migrations to run


definewater
HOBBYOP

2 years ago

how would i do that


2 years ago

that would kinda be out of scope as it wouldn't have anything to do with the platform or running your app on the platform


2 years ago

I'm sure you could find some information about what I've said, I'm just trying to get you running and then point you in the correct direction


definewater
HOBBYOP

2 years ago

my man let me se if it works


definewater
HOBBYOP

2 years ago

nope still failing to launch


2 years ago

deploy logs please


definewater
HOBBYOP

2 years ago

shall i do same for sync maybe


definewater
HOBBYOP

2 years ago


2 years ago

give it a try


definewater
HOBBYOP

2 years ago

ye just did its deploying


2 years ago

this, I replied to the wrong message


definewater
HOBBYOP

2 years ago

works!!!


definewater
HOBBYOP

2 years ago

thanks


2 years ago

no problem!


Loading...