Typeorm migration run

definewater
HOBBY

a year 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 -.-

0 Replies

definewater
HOBBY

a year ago

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



definewater
HOBBY

a year ago


definewater
HOBBY

a year ago

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

definewater
HOBBY

a year ago

this is the eye catchin part ^^


definewater
HOBBY

a year ago

also this


definewater
HOBBY

a year 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
HOBBY

a year 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


a year ago

change the && after the migration command to a semicolon


definewater
HOBBY

a year ago

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


definewater
HOBBY

a year ago

like this?


a year ago

that's not a semicolon


definewater
HOBBY

a year ago

sorry ahhahahaahah


definewater
HOBBY

a year ago

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


definewater
HOBBY

a year ago

OH AFTER


definewater
HOBBY

a year ago

sorry


a year ago

yep


definewater
HOBBY

a year ago

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

a year 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
HOBBY

a year ago

how would i do that


a year 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


a year 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
HOBBY

a year ago

my man let me se if it works


definewater
HOBBY

a year ago

nope still failing to launch


a year ago

deploy logs please


definewater
HOBBY

a year ago

shall i do same for sync maybe


definewater
HOBBY

a year ago


a year ago

give it a try


definewater
HOBBY

a year ago

ye just did its deploying


a year ago

this, I replied to the wrong message


definewater
HOBBY

a year ago

works!!!


definewater
HOBBY

a year ago

thanks


a year ago

no problem!


Typeorm migration run - Railway Help Station