mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 15:53:01 -06:00
more updates
This commit is contained in:
parent
2786b5f887
commit
7b01304dac
18 changed files with 1368 additions and 133 deletions
21
internal/db/bundb/migrations/README.md
Normal file
21
internal/db/bundb/migrations/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Migrations
|
||||
|
||||
## How do I write a migration file?
|
||||
|
||||
[See here](https://bun.uptrace.dev/guide/migrations.html#migration-names)
|
||||
|
||||
As a template, take one of the existing migration files and modify it. It will be automatically loaded and handled by Bun.
|
||||
|
||||
## File format
|
||||
|
||||
Bun requires a very specific format: 14 digits, then letters or underscores.
|
||||
|
||||
You can use the following bash command on your branch to generate a suitable migration filename.
|
||||
|
||||
```bash
|
||||
echo "$(date --utc +%Y%m%H%M%S%N | head -c 14)_$(git rev-parse --abbrev-ref HEAD).go"
|
||||
```
|
||||
|
||||
## Rules of thumb
|
||||
|
||||
1. **DON'T DROP TABLES**!!!!!!!!
|
||||
Loading…
Add table
Add a link
Reference in a new issue