执行 heroku db:push 给出 ArgumentError: invalid date (Sequel::InvalidValue) 这是标准的吗?

发布于 2024-10-14 00:47:03 字数 1442 浏览 1 评论 0原文

执行 heroku db:push

一切似乎都很顺利

发送模式 架构:100% |==============================================|时间:00:00:05 发送索引 schema_migrat:100% |==========================================|时间:00:00:00 用户:100% |================================================ =============|时间:00:00:01 历史: 100% |================================================ ===========|时间:00:00:00 发送数据 4张表,587条记录

schema_migrat:100% |============================================ ======|时间:00:00:00

当我得到

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1573:in new_by_frags': ArgumentError: 无效日期(续集::无效值) 来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1618:inparse' 来自 /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:222:in string_to_datetime' 来自 /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:92:inconvert_input_timestamp' 来自 /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:163:in convert_timestamp' 来自 /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:46:indatabase_to_application_timestamp'

编辑:添加架构/迁移

t.string "apothiki" 
t.string "timh" 
t.datetime "created_at" 
t.datetime "updated_at" 
t.string "photo_file_name" 
t.string "photo_content_type" 
t.integer "photo_file_size" 
t.datetime "photo_updated_at"

Performing a heroku db:push

everything seem to be going ok

Sending schema
Schema: 100% |==========================================| Time: 00:00:05
Sending indexes
schema_migrat: 100% |=====================================| Time: 00:00:00
users: 100% |==========================================================| Time: 00:00:01
histories: 100% |========================================================| Time: 00:00:00
Sending data
4 tables, 587 records

schema_migrat: 100% |==============================================| Time: 00:00:00

when i get

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1573:in new_by_frags': ArgumentError: invalid date (Sequel::InvalidValue)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1618:in
parse'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:222:in string_to_datetime'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:92:in
convert_input_timestamp'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:163:in convert_timestamp'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/timezones.rb:46:in
database_to_application_timestamp'

EDIT: Adding Schema/Migration


t.string "apothiki"
t.string "timh"
t.datetime "created_at"
t.datetime "updated_at"
t.string "photo_file_name"
t.string "photo_content_type"
t.integer "photo_file_size"
t.datetime "photo_updated_at"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

許願樹丅啲祈禱 2024-10-21 00:47:03

好的,我正在从 CSV 文件导入数据,但创建和修改的所有日期时间都是空的,这对于本地部署 sqlite 来说不是问题。一旦我为所有记录填写了正确的日期,它肯定会推动数据库正常运行。这样就解决了!感谢您的帮助!

Ok, i was importing my data from an CSV file but all my datetimes from created and modified were empty, and that wasnt a problem with sqlite deploying locally. once i filled proper dates to all the records it sure pushed the db okay. so solved! thanks for the help!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文