Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove : from all migration file names πŸ—‚οΈ #97

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/how-to-implement-a-database-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ files in the following manner:
For example, a valid migration name is:

```
2024-01-29T19:05:29Z-birthdate.ts
20240311103301_job_offers.ts
```

To get the ISO timestamp, you can simply open up a node terminal and run:
## Common Errors

```
new Date()
Error: corrupted migrations: previously executed migration <SOME_MIGRATION_NAME> is missing.
```

and the output should be exactly what we want.
The easiest way to fix this is to re-setup your database by running:

```
yarn db:setup
```
7 changes: 6 additions & 1 deletion packages/db/src/use-cases/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ export async function migrate(options: MigrateOptions = defaultOptions) {
}

if (error) {
console.error('An error occurred with the Kysely migrator.', error);
console.error(
'Something went wrong! To debug, see common migration errors here:',
'https://github.com/colorstackorg/oyster/blob/main/docs/how-to-implement-a-database-migration.md#common-errors.',
error
);

process.exit(1);
}

Expand Down