Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

why convert a type "smallint" in progresql to int in go model? #14

Open
xubing opened this issue Jun 27, 2016 · 2 comments
Open

why convert a type "smallint" in progresql to int in go model? #14

xubing opened this issue Jun 27, 2016 · 2 comments

Comments

@xubing
Copy link

xubing commented Jun 27, 2016

我在使用reverse转化progresql到model的时候,smallint类型转化成了int。
我查看代码,代码中其实已经有了smallint等int 类型的判断了。为什么生成model中是int,而不是int8 或者int16这样的呢。

@lunny
Copy link
Member

lunny commented Jun 27, 2016

postgres有smallint吗?

@xubing
Copy link
Author

xubing commented Jun 27, 2016

当然有。Postgresql的的数字类型

  • smallint 2 bytes
    • integer 4
    • bigint 8
    • decimal variable
    • numeric variable
    • real 4 bytes
    • double precision 8
    • smallserial 2 bytes 1-32767
    • serial 4 bytes
    • bigserial 8 bytes

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

No branches or pull requests

2 participants