Skip to content
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

'timestamp with time zone' for sql definition #1

Open
stanislavt opened this issue Aug 29, 2016 · 6 comments
Open

'timestamp with time zone' for sql definition #1

stanislavt opened this issue Aug 29, 2016 · 6 comments

Comments

@stanislavt
Copy link

stanislavt commented Aug 29, 2016

Hi!
Will it possible to add one more datatype? I want to use 'timestamp with time zone' datatype for created and lastupdated columns. For my project I have used it like:
created: 'timestamp with time zone', lastupdated: 'timestamp with time zone'
but it calls a warning in console: [WARN] Using unknown data type TIMESTAMP WITH TIME ZONE.
I think the new datatype in the datatypes would be perfect!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37369760-timestamp-with-time-zone-for-sql-definition?utm_campaign=plugin&utm_content=tracker%2F39837989&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F39837989&utm_medium=issues&utm_source=github).
@wzrdtales
Copy link
Member

No. This is driver dependend, not shared depended. It would be shared if this would apply to all databases though.

Please refer to the driver this belongs to, also are you sure that this works like you described it? And you should also not that this is not a dataType anymore. The dataType actually would be timestamp and with time zone is an option, but not a dataType.

@stanislavt
Copy link
Author

Ok, thank you!

Could you tell me please, how can I Add this option?
db.createTable('airline', { id: {type: 'int', primaryKey: true, autoIncrement: true}, name: 'string', created: 'timestamp' }, cb);

@stanislavt
Copy link
Author

Can I add index for column while creating the new table?

@wzrdtales
Copy link
Member

Only primary keys currently, so no not as of now.

To your other question: Not without having a new constraint added to the pg driver.
https://github.com/db-migrate/pg/blob/master/index.js#L268

@stanislavt
Copy link
Author

Thanks a lot!

@wzrdtales
Copy link
Member

wzrdtales commented Aug 31, 2016

@stanislavt No problem, if you plan to go for a PR on the postgres driver, please feel welcome to do so. I'm always here and open for opinions and questions. If you need or want to know anything, just let me know and I will see what I can do.

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

No branches or pull requests

2 participants