PostgreSQL schema and initialization scripts for the e-commerce platform.
ecomm_database/
├── config/ # Schema and init scripts (init.sql)
├── src/ # Additional scripts (if needed)
├── tests/ # Test files
└── README.md
- Create a PostgreSQL database named
ecommerce - Run the init script:
psql -U postgres -d ecommerce -f config/init.sql
Or use Docker:
docker run -d --name ecomm-db -e POSTGRES_DB=ecommerce -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:15
# Then run init.sql against the container- products - Product catalog (id, name, price, description, created_at)
- orders - Orders (id, product_id, quantity, total_price, status, created_at)