Skip to content

bug: Asana plugin migration uses MySQL-specific "double" type, fails on PostgreSQL #8835

@JAORMX

Description

@JAORMX

Search before asking

  • I had mass searched in the 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:

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

StoryPoint *float64 `gorm:"type:double"`

Fix: Remove the explicit type tag:

StoryPoint *float64

GORM will infer double precision on PostgreSQL and double on MySQL.

Workaround: Create a PostgreSQL domain alias before running migrations:

CREATE DOMAIN double AS double precision;

Version

v1.0.3-beta10

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/pluginsThis issue or PR relates to pluginspriority/highThis issue is very importantseverity/p0This bug blocks key user journey and functiontype/bugThis issue is a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions