Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Triggsy22 opened this issue Jun 1, 2023 · 0 comments

Comments

@Triggsy22
Copy link

Triggsy22 commented Jun 1, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant