Extended environment variable usage to export scripts and simplified
the env loading pattern across all scripts.
Changes:
- sexy/db/export: now uses $DB_USER and $SEXY_DB_NAME
- sexy/export/all: now uses $DB_USER and $SEXY_DB_NAME
- All scripts: changed from 'set -a && source .env && set +a' to
'export $(cat .env | xargs)' for cleaner, more concise syntax
This ensures consistent variable usage across all import/export scripts
and makes them work correctly in all environments.
Added 'set -a && source .env && set +a' at the beginning of import scripts
to load environment variables from .env file.
This ensures DB_USER and SEXY_DB_NAME are properly set before executing
docker commands, regardless of whether arty exports them or not.
- set -a: enables automatic export of variables
- source .env: loads variables from .env file
- set +a: disables automatic export
Changed from ${DB_USER}/${SEXY_DB_NAME} to $DB_USER/$SEXY_DB_NAME
for proper variable expansion in arty scripts.
Arty exports environment variables before executing scripts, so simple
$VAR syntax works correctly, while ${VAR} was being treated as literal
text in the shell context.
Changed from ${DB_USER} and ${SEXY_DB_NAME} variables to hardcoded
values 'valknar' and 'directus' for production VPS environment.
Arty environment variables are not exported to the shell where scripts
execute, so the variables were empty when docker exec commands ran.
Production VPS always uses:
- PostgreSQL container: core_postgres
- DB user: valknar
- Database name: directus
These values are stable for production and won't change.
Removed interactive confirmation prompt (read -p and if/else/fi) from
sexy/import/all script. The if/else control structure caused syntax errors
when executed via arty due to how arty appends "$@" to scripts.
The script now runs directly without confirmation. Users should be careful
when running this destructive operation as it will immediately:
1. Drop and recreate all database tables
2. Apply Directus schema snapshot
3. Restart the Directus API
Warning message is still displayed before execution.
Changed hardcoded database credentials to use environment variables:
- `-U sexy` → `-U ${DB_USER}`
- `-d sexy` → `-d ${SEXY_DB_NAME}`
Also added missing interactive confirmation prompt to sexy/import/all script.
This fixes the script error on VPS where:
- VPS uses: DB_USER=valknar, SEXY_DB_NAME=directus
- Local dev uses: DB_USER=sexy, SEXY_DB_NAME=sexy (or directus)
The scripts now work correctly in both environments by reading
the appropriate values from .env files via arty's environment system.
Change duration column from integer to numeric(10,2) to support
decimal values in milliseconds. Fixes error when saving recordings
with fractional durations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added missing sexy_recordings table which stores hardware device session recordings. This table is required for the /me dashboard page to load properly.
Table structure:
- id, title, description, slug (unique)
- duration (integer), events (JSONB), device_info (JSONB)
- tags (text array), linked_video (foreign key to sexy_videos)
- status (draft/published/archived), public flag
- user_created/updated, date_created/updated
- Indexes on user_created, status, slug, linked_video, tags (GIN)
This fixes the 5-minute timeout issue on /me page where the recordings endpoint was trying to access a non-existent table.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added sexy_model_photos and sexy_videos_models junction tables to support
many-to-many relationships between models/files and videos/models.
This resolves 500 errors on homepage and endpoints that were querying
these missing tables.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added missing database tables and columns for video engagement:
- sexy_video_likes: tracks user likes on videos
- sexy_video_plays: tracks video play analytics
- sexy_videos: added likes_count, plays_count, views_count columns
This enables the like/unlike feature and video analytics that were
already implemented in the frontend but missing the database schema.
Tables include proper indexes and foreign key constraints for performance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>