Add sale management feature for admin panel
- Add database migration for sale fields (percentage, active, dates) - Update API to handle sale operations and bulk updates - Create SaleManager component for admin interface - Update FilamentTableV2 to display sale prices on frontend - Add sale column in admin dashboard - Implement sale price calculations with strikethrough styling
This commit is contained in:
17
scripts/run-sale-migration.sh
Executable file
17
scripts/run-sale-migration.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Running sale fields migration..."
|
||||
|
||||
# Get RDS endpoint from AWS
|
||||
RDS_ENDPOINT=$(aws rds describe-db-instances --region eu-central-1 --db-instance-identifier filamenteka --query 'DBInstances[0].Endpoint.Address' --output text)
|
||||
|
||||
# Get database credentials from Secrets Manager
|
||||
DB_CREDS=$(aws secretsmanager get-secret-value --region eu-central-1 --secret-id filamenteka-db-credentials --query 'SecretString' --output text)
|
||||
DB_USER=$(echo $DB_CREDS | jq -r '.username')
|
||||
DB_PASS=$(echo $DB_CREDS | jq -r '.password')
|
||||
DB_NAME=$(echo $DB_CREDS | jq -r '.database')
|
||||
|
||||
# Run the migration
|
||||
PGPASSWORD="$DB_PASS" psql -h $RDS_ENDPOINT -U $DB_USER -d $DB_NAME -f database/migrations/014_add_sale_fields.sql
|
||||
|
||||
echo "Migration completed!"
|
||||
Reference in New Issue
Block a user