Sequence type

Is there a way to get serial or bigserial for an :integer type in AshPostgres?
2 Replies
ZachDaniel
ZachDaniel3y ago
Yep!
integer_primary_key :id
integer_primary_key :id
will do it, but you can also do it without a primary key using
attribute :foo, :integer do
generated? true
end
attribute :foo, :integer do
generated? true
end
If memory serves, AshPostgres will detect that it is supposed to generate a value for it, and thus will migrate it as a serial column
\ ឵឵឵
\ ឵឵឵OP3y ago
Right, I'd like to retain the UUID PK, will try the second one. Thanks!

Did you find this page helpful?