-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
table.timestamps() creates unusable column names with sailsjs #754
Comments
IMO sql column names shouldn't be camel cased, but if you insist, just use timestamp rather than timestamps. It's one extra line: table.timestamp('createdAt')
table.timestamp('updatedAt') |
Also, I'll probably make this configurable at some point but right now I'm refactoring a ton of stuff internally so it's not something I'm going to fix just yet. |
@tgriesser Even if you are postponing this, it is best to keep the issue open (and tag it 'backlog', 'future', whatever) - otherwise how will you remember? |
Eh I'll just leave it open. |
Thx :) |
@tgriesser is this something that could be fixed now, i'm running into similar issues, it just seems like it should have an options object with columnName as an optional attribute or something? |
@KieranHolroyd This will be fixed in 1.0.0 which should be released this week. There is a new option for that. |
Yes, this function have now useCamelCase option: timestamps — table.timestamps([useTimestamps], [defaultToNow], [useCamelCase]) |
Issue
table.timestamps()
createscreated_at
andupdated_at
while sailsjs is expectingcreatedAt
andupdatedAt
More information: BlueHotDog/sails-migrations#59
The text was updated successfully, but these errors were encountered: