Encourage not to use serial in newer PostgreSQL versions
Open
- Dominant language
- JavaScript
- Stars
- 3.7k
- Forks
- 233
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Hello,
Since PostgreSQL 10, usage of `serial` is [not recommended]. So, I guess it's better to suggest the usage of `GENERATED BY DEFAULT AS IDENTITY`. First reason PostgreSQL's approach is not how things are done in SQL standard. With this change, things are done similarly to DB2 and Oracle. The following snippet is where this support can be implemented.
https://github.com/holistics/dbml/blob/5a5513e0bdf7104e12b4e8e98bf88d99aca7c493/packages/dbml-core/src/parse/postgresql/Commands/Create_table/Create_table_normal.pegjs#L140
[not recommended]: https://wiki.postgresql.org/wiki/Don't_Do_This#Don't_use_serial
Contributor guide
Assessment
This issue has not been assessed yet.