db-seed

📁 forever-efficient/pitfal-solutions-website 📅 Jan 26, 2026
22
总安装量
2
周安装量
#16627
全站排名
安装命令
npx skills add https://github.com/forever-efficient/pitfal-solutions-website --skill db-seed

Agent 安装分布

mcpjam 2
qwen-code 2
windsurf 2
crush 2
claude-code 2

Skill 文档

Seed Database

Populate DynamoDB tables with sample data for development/testing.

WARNING

This skill modifies database data. ALWAYS verify the environment before proceeding.

Pre-checks

  1. Verify environment (NEVER run in production!):

    echo "Current AWS Profile: $AWS_PROFILE"
    aws sts get-caller-identity --profile pitfal
    
  2. Confirm with user before proceeding

Seed Commands

Seed All Tables (Recommended Order)

# 1. Seed admin users and settings first
aws dynamodb batch-write-item \
  --request-items file://scripts/seed-admin.json \
  --profile pitfal

# 2. Seed galleries and images
aws dynamodb batch-write-item \
  --request-items file://scripts/seed-galleries.json \
  --profile pitfal

# 3. Seed sample inquiries
aws dynamodb batch-write-item \
  --request-items file://scripts/seed-inquiries.json \
  --profile pitfal

Seed Individual Tables

Admin Users & Settings

aws dynamodb batch-write-item \
  --request-items file://scripts/seed-admin.json \
  --profile pitfal

Galleries & Images

aws dynamodb batch-write-item \
  --request-items file://scripts/seed-galleries.json \
  --profile pitfal

Inquiries

aws dynamodb batch-write-item \
  --request-items file://scripts/seed-inquiries.json \
  --profile pitfal

Verify Seeding

# Count items in galleries table
aws dynamodb scan \
  --table-name pitfal-galleries \
  --select COUNT \
  --profile pitfal

# Count items in inquiries table
aws dynamodb scan \
  --table-name pitfal-inquiries \
  --select COUNT \
  --profile pitfal

# Count items in admin table
aws dynamodb scan \
  --table-name pitfal-admin \
  --select COUNT \
  --profile pitfal

Seed Data Contents

File Contents
seed-admin.json Admin user, site settings, services, testimonials, FAQs
seed-galleries.json Sample galleries (brand, portrait, event) with images
seed-inquiries.json Sample booking inquiries in various statuses

Default Admin Credentials

  • Username: admin
  • Password: admin123 (change immediately in production!)
  • Note: Password hash in seed file is bcrypt with cost factor 12

Clear Data (Development Only)

To remove all seed data:

# This is destructive - confirm before running
aws dynamodb delete-table --table-name pitfal-galleries --profile pitfal
aws dynamodb delete-table --table-name pitfal-inquiries --profile pitfal
aws dynamodb delete-table --table-name pitfal-admin --profile pitfal
# Then re-run terraform apply to recreate tables