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

Support xid types in postgres #2771

Open
enrique-fernandez-polo opened this issue May 11, 2024 · 3 comments
Open

Support xid types in postgres #2771

enrique-fernandez-polo opened this issue May 11, 2024 · 3 comments

Comments

@enrique-fernandez-polo
Copy link

Hello there!

I am using watermill in my project with the SQL It creates a set of tables where the different elements publish and subscribe for events.

Watermill can create the tables for you but I prefer to have all the database changes centralized using the same tool.

One of the types that watermill uses is xid8. I've tried

type = sql("xid8")

Is it possible to create a table with this type? Do I have to wait for this type to be supported?

Thanks in advance!

@a8m
Copy link
Member

a8m commented May 11, 2024

Hey, @enrique-fernandez-polo

As mentioned in #2769, there is no special handling for each external/user-defined type. You should use sql(…) for any type that is not supported by the HCL syntax.

@enrique-fernandez-polo
Copy link
Author

Hello!

Then I guess the error Error: create table "watermill_deployments": postgres: unsupported type: "xid8" Comes from the postgres instance not atlas?

@enrique-fernandez-polo
Copy link
Author

I am confused with this issue. I get the error generating the migrations if use hcl syntax and sql syntaxt but If I connect to the database I can execute the SQL query to create the table.

table "test" {
  column "transaction_id" {
    type = sql("xid8")
  }
}
create table "test"
(
  transaction_id xid8 not null
)

If I execute the create table in the database I do not get any error.

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

2 participants