feat: Migrate data storage to PostgreSQL with schema setup, initialization script, and update documentation
This commit is contained in:
36
README.md
36
README.md
@@ -176,13 +176,35 @@ Example configuration for Claude Desktop (`claude_desktop_config.json`):
|
||||
|
||||
## Data Storage
|
||||
|
||||
All data is stored locally in JSON files in the `data/` directory:
|
||||
- `codeSnippets.json` - Code snippets
|
||||
- `notes.json` - Personal notes
|
||||
- `tasks.json` - Tasks
|
||||
- `babyMilestones.json` - Baby milestones
|
||||
- `mathResources.json` - Math resources
|
||||
- `gameWishlist.json` - Game wishlist
|
||||
All data is stored in PostgreSQL database. The application requires a PostgreSQL database connection.
|
||||
|
||||
### Database Setup
|
||||
|
||||
1. **Configure Database Connection**
|
||||
|
||||
Set the `DATABASE_URL` environment variable in your `.env` file:
|
||||
```
|
||||
DATABASE_URL=postgresql://user:password@host:port/database
|
||||
```
|
||||
|
||||
2. **Initialize Database Schema**
|
||||
|
||||
Run the initialization script to create all required tables:
|
||||
```bash
|
||||
bun run init-db
|
||||
```
|
||||
|
||||
This will create the following tables:
|
||||
- `code_snippets` - Code snippets
|
||||
- `notes` - Personal notes
|
||||
- `tasks` - Tasks
|
||||
- `baby_milestones` - Baby milestones
|
||||
- `math_resources` - Math resources
|
||||
- `game_wishlist` - Game wishlist
|
||||
|
||||
### Database Schema
|
||||
|
||||
The database schema is defined in `src/storage/schema.sql`. All tables include appropriate indexes for optimal query performance.
|
||||
|
||||
## Development
|
||||
|
||||
|
||||
Reference in New Issue
Block a user