Initial lookbook implementation
Pinterest-style visual bookmarking app with: - URL metadata extraction (OG/Twitter meta, oEmbed fallback) - Image caching in Postgres with 480px thumbnails - Multi-tag filtering with Ctrl/Cmd for OR mode - Fuzzy tag suggestions and inline tag editing - Browser console auth() with first-use password setup - Brutalist UI with Commit Mono font and Pico CSS - Light/dark mode via browser preference
This commit is contained in:
commit
fc625fb9cf
486 changed files with 195373 additions and 0 deletions
54
vendor/github.com/pressly/goose/v3/fix.go
generated
vendored
Normal file
54
vendor/github.com/pressly/goose/v3/fix.go
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package goose
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const seqVersionTemplate = "%05v"
|
||||
|
||||
func Fix(dir string) error {
|
||||
// always use osFS here because it's modifying operation
|
||||
migrations, err := collectMigrationsFS(osFS{}, dir, minVersion, maxVersion, registeredGoMigrations)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// split into timestamped and versioned migrations
|
||||
tsMigrations, err := migrations.timestamped()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vMigrations, err := migrations.versioned()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Initial version.
|
||||
version := int64(1)
|
||||
if last, err := vMigrations.Last(); err == nil {
|
||||
version = last.Version + 1
|
||||
}
|
||||
|
||||
// fix filenames by replacing timestamps with sequential versions
|
||||
for _, tsm := range tsMigrations {
|
||||
oldPath := tsm.Source
|
||||
newPath := strings.Replace(
|
||||
oldPath,
|
||||
fmt.Sprintf("%d", tsm.Version),
|
||||
fmt.Sprintf(seqVersionTemplate, version),
|
||||
1,
|
||||
)
|
||||
|
||||
if err := os.Rename(oldPath, newPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Printf("RENAMED %s => %s", filepath.Base(oldPath), filepath.Base(newPath))
|
||||
version++
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue