JAORMX opened a new issue, #8835:
URL: https://github.com/apache/incubator-devlake/issues/8835

   ## Search before asking
   
   - [x] I had mass searched in the 
[issues](https://github.com/apache/incubator-devlake/issues) and found no 
similar issues.
   
   ## What happened
   
   The Asana plugin migration `20250212_add_task_transformation_fields` uses 
`gorm:"type:double"` on the `StoryPoint` field. PostgreSQL does not have a 
`double` type (it uses `double precision`), so the migration fails with:
   
   ```
   ERROR: type "double" does not exist (SQLSTATE 42704)
   ```
   
   The failing DDL:
   ```sql
   ALTER TABLE "_tool_asana_tasks" ALTER COLUMN "story_point" TYPE double USING 
"story_point"::double
   ```
   
   ## What do you expect to happen
   
   The migration should use a database-agnostic type. Removing the explicit 
`gorm:"type:double"` tag and letting GORM infer the type from `*float64` would 
work correctly on both MySQL and PostgreSQL.
   
   ## How to reproduce
   
   1. Configure DevLake v1.0.3-beta10 with a PostgreSQL backend 
(`DB_URL=postgres://...`)
   2. Trigger database migration via `/proceed-db-migration`
   3. Migration fails on the Asana plugin step
   
   ## Anything else
   
   The same class of bug was fixed for the copilot plugin's `datetime` type in 
#8779. This is the same pattern: a MySQL-specific type in a GORM struct tag 
that breaks PostgreSQL.
   
   **Affected file:** 
`backend/plugins/asana/models/migrationscripts/20250212_add_task_transformation_fields.go:35`
   
   ```go
   StoryPoint *float64 `gorm:"type:double"`
   ```
   
   **Fix:** Remove the explicit type tag:
   ```go
   StoryPoint *float64
   ```
   
   GORM will infer `double precision` on PostgreSQL and `double` on MySQL.
   
   **Workaround:** Create a PostgreSQL domain alias before running migrations:
   ```sql
   CREATE DOMAIN double AS double precision;
   ```
   
   ## Version
   
   v1.0.3-beta10


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to