-
-
Notifications
You must be signed in to change notification settings - Fork 51
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 smallserial and bigserial data type. #4
Comments
As there is also bigint in postgre, this would rather be named BIG_SERIAL instead of BIG_INTEGER. If you wont mind you could also open a PR and we work on getting this into this driver. |
Do you mean we're going to add additional types such as By the way, I'm willing to make a PR for this issue :) |
To support db specifics better drivers are now not a part of the project anymore and every driver will and should contain its own documentation outlining the differences. But to discuss this, may be it makes sense anyway to additionally add what you suggested. Using the proper datatypes for postgre if autoincrement is getting set. This would add both: The support of the datatypes itself and the handling of the generic datatypes that are available overall. |
With not the project I meant, they are not a part of db-migrate, the main module, anymore, but are standalone now. While db-migrate enforces some opinions there is still the freedom for drivers to support some specifics. But that would also ment that they need to maintain those. For all drivers officially maintained this is the same. And there are plans to extend the drivers to get the most out of the different systems. For example there is a new driver planned, the MariaDB driver which is supporting specifics like virtual columns, dynamic columns and so on and so forth. I wanted to write a bit about how I imagine how drivers are related to db-migrate and what a good migration looks like for me, but really haven't had the time for it. I need to set me a date for this to finally do it :) |
Yeah, I agree on what you think of. Supporting all databases only with generic data types has a clear limit. I'll keep this issue until it's ready, then I could make a PR for it. |
Yes there are some things that need some time, there is also a big chunk that is upcoming for db-migrate. I'm currently redesigning some things such as the seeder handling and changes to the testing. Tests are currently only on db-migrates level but they need to be migrated to the drivers itself. Please feel free to suggest, ask and also help whenever you want, I will try to answer and react as fast as possible :) |
That sounds nice. Testing drivers on their own repo is exactly what i was thinking. If you can make some TODOs, maybe I can help you on free time. |
I think I will transfer my tasks from asana into issues and take some time to describe them all. I have marked me the sunday to start with this :) |
Before outputting the primary key constraint just check the specified data type and output the preferred SERIAL version. SERIAL as fallback. |
Any progress on this? |
Unlike mysql's
auto_increment
constraint, postgresql has 3 different types for autoincrement fieldsmallserial
,serial
,bigserial
.For example,
I tried this code but it creates
serial
type which is unexpected behavior. From quick look of source code, I think it would be same forsmallserial
type as well. It could be easily fixed like below.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: