Before updates to NHTSA
This commit is contained in:
@@ -31,20 +31,30 @@ docker exec -i mvp-postgres psql -U postgres -d motovaultpro < migrations/001_cr
|
||||
echo "✓ Schema migration completed"
|
||||
echo ""
|
||||
|
||||
# Truncate tables for a clean rerun
|
||||
echo "🧹 Step 2: Truncating existing data..."
|
||||
docker exec -i mvp-postgres psql -U postgres -d motovaultpro <<'EOF'
|
||||
TRUNCATE TABLE vehicle_options RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE engines RESTART IDENTITY CASCADE;
|
||||
TRUNCATE TABLE transmissions RESTART IDENTITY CASCADE;
|
||||
EOF
|
||||
echo "✓ Tables truncated"
|
||||
echo ""
|
||||
|
||||
# Import engines
|
||||
echo "📥 Step 2: Importing engines (34MB)..."
|
||||
echo "📥 Step 3: Importing engines..."
|
||||
docker exec -i mvp-postgres psql -U postgres -d motovaultpro < output/01_engines.sql
|
||||
echo "✓ Engines imported"
|
||||
echo ""
|
||||
|
||||
# Import transmissions
|
||||
echo "📥 Step 3: Importing transmissions..."
|
||||
echo "📥 Step 4: Importing transmissions..."
|
||||
docker exec -i mvp-postgres psql -U postgres -d motovaultpro < output/02_transmissions.sql
|
||||
echo "✓ Transmissions imported"
|
||||
echo ""
|
||||
|
||||
# Import vehicle options
|
||||
echo "📥 Step 4: Importing vehicle options (56MB - this may take a minute)..."
|
||||
echo "📥 Step 5: Importing vehicle options (this may take a minute)..."
|
||||
docker exec -i mvp-postgres psql -U postgres -d motovaultpro < output/03_vehicle_options.sql
|
||||
echo "✓ Vehicle options imported"
|
||||
echo ""
|
||||
@@ -58,6 +68,7 @@ echo "🔍 Database verification:"
|
||||
docker exec mvp-postgres psql -U postgres -d motovaultpro -c "SELECT COUNT(*) as engine_count FROM engines;"
|
||||
docker exec mvp-postgres psql -U postgres -d motovaultpro -c "SELECT COUNT(*) as transmission_count FROM transmissions;"
|
||||
docker exec mvp-postgres psql -U postgres -d motovaultpro -c "SELECT COUNT(*) as vehicle_count FROM vehicle_options;"
|
||||
docker exec mvp-postgres psql -U postgres -d motovaultpro -c "SELECT MIN(year) as min_year, MAX(year) as max_year FROM vehicle_options;"
|
||||
echo ""
|
||||
docker exec mvp-postgres psql -U postgres -d motovaultpro -c "SELECT * FROM available_years;"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user