K
Kysely14mo ago
Blåhaj

Migrate beyond 9 (to `10-...`)

Hey, I am trying to run a new migration called 10-passport but I am always getting this error:
Error: corrupted migrations: expected previously executed migration 2-userguilds to be at index 2 but 10 was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.
Error: corrupted migrations: expected previously executed migration 2-userguilds to be at index 2 but 10 was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.
I tried the following to options to migrate: 1st.
const { error, results } = await migrator.migrateToLatest();
const { error, results } = await migrator.migrateToLatest();
2nd.
const { error, results } = await migrator.migrateTo("10-passport");
const { error, results } = await migrator.migrateTo("10-passport");
All previous migrations and folder structure as attachments:
No description
No description
2 Replies
Igal
Igal14mo ago
Hey 👋 The migration files should be ordered in lexicographic order. 10 is smaller than 9 since 1 is smaller than 9. You should use UNIX timestamps instead.
Blåhaj
Blåhaj14mo ago
I just went with a1 but thanks!
Want results from more Discord servers?
Add your server