mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-18 02:20:37 -05:00
Fix migration 050 on MySQL; add the estimate status column
- 050 wrote the kept rows' times back with their zone offset ('2026-10-31 10:06:08 -0400'), which MySQL
refuses; dates and times are now written with Rails' quoted_date. Each record's delete and re-insert
run in one transaction, so a failure can't leave it deleted.
- 051 adds estimates.txn_status for databases that ran migration 047 before that column was added to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
2 files changed
+37
-3
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#The MIT License (MIT)
|
||||
#
|
||||
#Copyright (c) 2026 rick barrette
|
||||
#
|
||||
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
# Each estimate's QuickBooks status (Converted and Closed estimates are billed, so lists show View instead of
|
||||
# Edit). Added to migration 047 after some databases had already run it, so it's added here for those.
|
||||
class AddEstimateStatus < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
add_column :estimates, :txn_status, :string unless column_exists?(:estimates, :txn_status)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :estimates, :txn_status if column_exists?(:estimates, :txn_status)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user