AOSSIE-Org / AOSSIE-Org/NeuroTrack

BUG: SQL Syntax Error

Đang mở
#144 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Dart
Star
29
Fork
50
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## 📌 Issue Overview
SQL schema has syntax errors preventing database setup

## 🔍 Steps to Reproduce
1. Go to Supabase Dashboard
2. Navigate to SQL Editor
3. Copy `supabase/schemas/schema.sql` file contents
4. Paste into Supabase SQL Editor
5. Click "Run"
6. See SQL syntax error

## 🎯 Expected Behavior
- All database tables should be created successfully
- No SQL errors should appear
- All 14 tables should be visible in Table Editor

## 🚨 Actual Behavior
- SQL syntax error appears
- Database tables are not created
- Error message: "syntax error at or near ')'"

## 📋 Error Details
The schema file contains 4 syntax errors (missing/extra commas):

1. **therapist table** (line ~23): Extra trailing comma before closing bracket
2. **daily_activity_logs table** (line ~142): Missing comma between `activity_items` and `patient_id` columns
3. **observation_master table** (line ~112): Extra trailing comma before closing bracket
4. **activity_master table** (line ~127): Extra trailing comma before closing bracket

## 📷 Error Message
Error: Failed to run sql query: ERROR: 42601: syntax error at or near ")" LINE 37: ); ^
## 📷 Screenshot

Image

## 💡 Suggested Improvements

## 💡 Suggested Fix
Fix comma placement in the following tables:

**therapist table:**
- Remove comma after `license_number TEXT,` → `license_number TEXT`

**daily_activity_logs table:**
- Add comma after `activity_items JSONB NOT NULL,` (currently missing)

**observation_master table:**
- Remove comma after `applicable_therapies UUID[] NOT NULL,` → `applicable_therapies UUID[] NOT NULL`

**activity_master table:**
- Remove comma after `applicable_therapies UUID[] NOT NULL,` → `applicable_therapies UUID[] NOT NULL`

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.