managarten/apps-archived/uload/scripts/migrate-links-collection.sh
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

63 lines
No EOL
1.9 KiB
Bash
Executable file

#!/bin/bash
# Migration script for PocketBase links collection
# This script documents the manual steps needed to replace the old links collection
echo "🔄 Links Collection Migration Guide"
echo "=================================="
cat << EOF
⚠️ IMPORTANT: Database Migration Required
The new 'links_improved' collection has been created with all the enhanced fields:
✅ created/updated timestamps (automatic)
✅ use_username (bool)
✅ click_count (number)
✅ last_clicked_at (date)
✅ utm_source, utm_medium, utm_campaign (text)
MANUAL STEPS REQUIRED IN POCKETBASE ADMIN:
1. BACKUP FIRST (!)
- Go to: https://pb.ulo.ad/_/
- Create a backup before proceeding
2. UPDATE REFERENCES:
Because the old 'links' collection has references (clicks, linktags),
we need to update the application code first:
a) Update all references in the app from 'links' to 'links_improved'
b) Test with the new collection
c) When everything works, delete the old collection
3. COLLECTION RENAMING:
After updating the code:
- Delete the old 'links' collection
- Rename 'links_improved' to 'links'
ALTERNATIVE APPROACH (RECOMMENDED):
Instead of renaming, update the application code to use 'links_improved'
and keep it as the new name.
EOF
echo ""
echo "📋 Migration Status:"
echo "✅ New collection 'links_improved' created"
echo "✅ Test data migrated successfully"
echo "✅ All new fields working correctly"
echo "⏳ Manual steps required (see above)"
echo ""
echo "🔍 Test the new collection:"
echo "Collection ID: pbc_394542459"
echo "Test records created: 2"
echo ""
# Show the test data
echo "📊 Sample data from new collection:"
echo "=================================="
echo "Test Link 1: TEST001 - https://example.com (with UTM tracking)"
echo "Test Link 2: JxBSn7 - https://ulo.ad/my/links (migrated)"
echo ""
echo "Both records have automatic timestamps ✅"