diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d2584ee..913fb3b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,6 +4,20 @@ This directory contains scripts and configuration files to set up a complete dev ## Quick Start +**For Development (Simple Workflow):** +```bash +# 1. One-time setup - installs dependencies and starts services +./setup-dev.sh + +# 2. Build the application +cargo build + +# 3. Run the application (migrations run automatically) +cargo run +``` + +**For Manual Step-by-Step Setup:** + 1. **One-time setup** (installs all dependencies): ```bash ./setup-dev.sh @@ -25,7 +39,7 @@ This directory contains scripts and configuration files to set up a complete dev - **`env.development`** - Environment variables for development - **`docker-compose.yml`** - PostgreSQL service configuration -- **`scripts/init-db.sql`** - Database initialization script +- **`migrations/`** - Database migration files (replaces deprecated init-db.sql) ### Scripts diff --git a/README.md b/README.md index 59c01d5..57a1880 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,17 @@ A cloud-native solution for providing Redis-as-a-Service on Kubernetes, accessib This project provides the management API and control plane for RedisGate. The development environment includes PostgreSQL for metadata storage, but actual Redis instances are managed by the Kubernetes operator. +**Simple Development Setup:** +```bash +# One-time setup (installs all dependencies and starts services) +./setup-dev.sh + +# Build and run the application (migrations run automatically) +cargo build +cargo run +``` + +**Alternative using Make commands:** ```bash # One-time setup (installs all dependencies) ./setup-dev.sh diff --git a/scripts/init-db.sql b/scripts/init-db.sql.deprecated similarity index 88% rename from scripts/init-db.sql rename to scripts/init-db.sql.deprecated index e88bfec..bc2c7f1 100644 --- a/scripts/init-db.sql +++ b/scripts/init-db.sql.deprecated @@ -1,3 +1,9 @@ +-- *** DEPRECATED - DO NOT USE *** +-- This file has been replaced by SQLx migrations in the migrations/ directory. +-- Using this file will cause conflicts with the migration system. +-- See migrations/README.md for more information. +-- *** DEPRECATED - DO NOT USE *** + -- RedisGate Development Database Initialization -- This script sets up the initial database schema for development diff --git a/setup-dev.sh b/setup-dev.sh index 4007fb0..10e874c 100755 --- a/setup-dev.sh +++ b/setup-dev.sh @@ -443,7 +443,7 @@ main() { echo "Configuration files:" echo " - Environment: $ENV_FILE" echo " - Docker Compose: $PROJECT_ROOT/docker-compose.yml" - echo " - Database Init: $PROJECT_ROOT/scripts/init-db.sql" + echo " - Database Migrations: $PROJECT_ROOT/migrations/" echo "" }