| name | database-migration |
| description | Create and apply database migrations for the MINDEX PostgreSQL database. Use when modifying database schema, adding tables, or changing columns. |
Database Migrations
MINDEX Database
All Mycosoft data is stored in MINDEX on VM 192.168.0.189.
Connection: postgresql://mycosoft:mycosoft@192.168.0.189:5432/mindex
Steps
Migration Progress:
- [ ] Step 1: Create migration file
- [ ] Step 2: Review the SQL
- [ ] Step 3: Apply to MINDEX VM
- [ ] Step 4: Verify schema
Step 1: Create migration file
Create a numbered migration in migrations/:
BEGIN;
CREATE TABLE IF NOT EXISTS new_table (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
data JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_new_table_name ON new_table(name);
COMMIT;
Step 2: Review the SQL