Stop the SQLite volume from hiding new migrations
Uploads on share.kadenpartner.ch failed with 409 on every chunk after the update to 2.1. The example docker-compose.yml mounts the SQLite volume over all of /app/database. Docker fills a volume from the image only when it is created, so the container kept the 2.0 migrations and never saw the 2.1 one. share_files.uploaded_chunks was never created, so the chunk endpoint read null and answered 409. SQLite takes the unknown "completed_at" in whereNull() as a string, so nothing failed earlier. - The image keeps a copy of its migrations in docker/migrations. On startup the entrypoint adds the ones missing from database/migrations before migrating, so installs with the old mount recover by pulling the new image. - docker-compose.example.yml and docker-compose.yml mount sealshare_database at /app/database/sqlite and set DB_DATABASE to the file in it. An existing volume can be moved there without losing data: its database.sqlite lands at exactly that path. - Tested with a locally built image: a volume created by 2.0.1 with the old mount gets the migration once (not again on restart) and keeps its settings; the same volume moved to the new path keeps its data; a fresh volume with the new layout starts healthy. - README and CHANGELOG (Unreleased) describe the new path and how to switch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
7ffc1c1ead
commit
c1906d2009
@@ -26,13 +26,14 @@ services:
|
||||
- "443:443/udp" # HTTP/3 (QUIC)
|
||||
volumes:
|
||||
- sealshare_storage:/app/storage/app # Uploaded & encrypted files
|
||||
- sealshare_database:/app/database # SQLite database
|
||||
- sealshare_database:/app/database/sqlite # SQLite database
|
||||
- caddy_data:/data # TLS certificates
|
||||
- caddy_config:/config # Caddy configuration
|
||||
environment:
|
||||
# --- REQUIRED ---
|
||||
APP_URL: # Your full URL, e.g. https://share.example.com
|
||||
# APP_KEY: # Auto-generated if not set. Copy from logs to persist across restarts.
|
||||
DB_DATABASE: /app/database/sqlite/database.sqlite # The SQLite file in sealshare_database
|
||||
|
||||
# --- HTTPS ---
|
||||
# Files are encrypted in the uploader's browser, which browsers only allow over HTTPS (or on
|
||||
@@ -51,7 +52,7 @@ services:
|
||||
# DB_CONNECTION: sqlite # Options: sqlite, mysql, pgsql
|
||||
# DB_HOST: # Required for mysql/pgsql
|
||||
# DB_PORT: # Required for mysql/pgsql
|
||||
# DB_DATABASE: # Required for mysql/pgsql
|
||||
# DB_DATABASE: # For mysql/pgsql the database's name, in place of the SQLite file above
|
||||
# DB_USERNAME: # Required for mysql/pgsql
|
||||
# DB_PASSWORD: # Required for mysql/pgsql
|
||||
|
||||
@@ -84,10 +85,11 @@ services:
|
||||
entrypoint: ["php", "artisan", "schedule:work"]
|
||||
volumes:
|
||||
- sealshare_storage:/app/storage/app
|
||||
- sealshare_database:/app/database
|
||||
- sealshare_database:/app/database/sqlite
|
||||
environment:
|
||||
# APP_KEY: # Same key as the app service above (auto-generated if not set)
|
||||
APP_URL: # Same URL as the app service above
|
||||
DB_DATABASE: /app/database/sqlite/database.sqlite # Same as the app service above
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
Reference in New Issue
Block a user