Skip to content

current_timestamp() as default value gets not migrated from mariadb to postgresql #109

@Triggsy22

Description

@Triggsy22

In a migration from mariadb to postgresql, when a column in mariadb has default of current_timstamp(), this default value gets not transfered to postgresql. Instead it gets no default value at all.

MariaDB Version: 10.3.38
PostgreSQL Version: 12.15

From the Log Files:

SQL: ALTER TABLE "public"."directus_files" ALTER COLUMN "modified_on" SET DEFAULT 'current_timestamp()';
--[DefaultProcessor::default] error: invalid input syntax for type timestamp: "current_timestamp()"

I think the real query should be:
ALTER TABLE "public"."directus_files" ALTER COLUMN "modified_on" SET DEFAULT CURRENT_TIMESTAMP;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions