fizz
fizz copied to clipboard
Create Auto inc fields
Hello
how do i create a migration with an integer field auto_incremental ? This field won't be the id or key.
I think you might want to have a look at this https://www.geeksforgeeks.org/sql-sequences/
There could be several approaches to achieve it.
- Of course, the simplest way with the current version of Fizz could be using
sql()so you can run your own SQL. - Supporting a user-defined option (e.g.
customorconstraint) could be one option. currently, only a few options are supported.- https://github.com/gobuffalo/fizz#supported-options
- e.g.
t.Column("my_col", "int", {"custom": "GENERATED ALWAYS AS IDENTITY"})
- Adding
auto_incrementoption could also be an option but I am not sure how many developers need it
I would like to postpone this to the next version.