Add migration for missing timestamps

pull/1026/head
Rick Carlino 2018-10-25 13:50:13 -05:00
parent 7846554e79
commit ff0bfc77bd
4 changed files with 33 additions and 16 deletions

View File

@ -63,19 +63,19 @@ FarmBot::Application.routes.draw do
patch "/device/:id" => "devices#update", as: :patch_device_redirect
put "/device/:id" => "devices#update", as: :put_device_redirect
delete "/api/fbos_config/:id" => "fbos_configs#destroy", as: "delete_fbos_config_redirect"
get "/api/fbos_config/:id" => "fbos_configs#show", as: "get_fbos_config_redirect"
put "/api/fbos_config/:id" => "fbos_configs#update", as: "put_fbos_config_redirect"
delete "/fbos_config/:id" => "fbos_configs#destroy", as: "delete_fbos_config_redirect"
get "/fbos_config/:id" => "fbos_configs#show", as: "get_fbos_config_redirect"
put "/fbos_config/:id" => "fbos_configs#update", as: "put_fbos_config_redirect"
delete "/api/firmware_config/:id" => "firmware_configs#destroy", as: "delete_firmware_config_redirect"
get "/api/firmware_config/:id" => "firmware_configs#show", as: "get_firmware_config_redirect"
patch "/api/firmware_config/:id" => "firmware_configs#update", as: "patch_firmware_config_redirect"
put "/api/firmware_config/:id" => "firmware_configs#update", as: "put_firmware_config_redirect"
delete "/firmware_config/:id" => "firmware_configs#destroy", as: "delete_firmware_config_redirect"
get "/firmware_config/:id" => "firmware_configs#show", as: "get_firmware_config_redirect"
patch "/firmware_config/:id" => "firmware_configs#update", as: "patch_firmware_config_redirect"
put "/firmware_config/:id" => "firmware_configs#update", as: "put_firmware_config_redirect"
delete "/api/web_app_config/:id" => "web_app_configs#destroy", as: "delete_web_app_config_redirect"
get "/api/web_app_config/:id" => "web_app_configs#show", as: "get_web_app_config_redirect"
patch "/api/web_app_config/:id" => "web_app_configs#update", as: "patch_web_app_config_redirect"
put "/api/web_app_config/:id" => "web_app_configs#update", as: "put_web_app_config_redirect"
delete "/web_app_config/:id" => "web_app_configs#destroy", as: "delete_web_app_config_redirect"
get "/web_app_config/:id" => "web_app_configs#show", as: "get_web_app_config_redirect"
patch "/web_app_config/:id" => "web_app_configs#update", as: "patch_web_app_config_redirect"
put "/web_app_config/:id" => "web_app_configs#update", as: "put_web_app_config_redirect"
patch "/users/:id" => "users#update", as: :patch_users_redirect
put "/users/:id" => "users#update", as: :put_users_redirect

View File

@ -0,0 +1,15 @@
class UnfortunateTimeStampFix < ActiveRecord::Migration[5.2]
def change
Device.where(updated_at: nil).update_all(updated_at: Time.now)
FarmEvent.where(updated_at: nil).update_all(updated_at: Time.now)
PlantTemplate.where(updated_at: nil).update_all(updated_at: Time.now)
RegimenItem.where(updated_at: nil).update_all(updated_at: Time.now)
Regimen.where(updated_at: nil).update_all(updated_at: Time.now)
Device.where(created_at: nil).update_all(created_at: Time.now)
FarmEvent.where(created_at: nil).update_all(created_at: Time.now)
PlantTemplate.where(created_at: nil).update_all(created_at: Time.now)
RegimenItem.where(created_at: nil).update_all(created_at: Time.now)
Regimen.where(created_at: nil).update_all(created_at: Time.now)
end
end

View File

@ -186,6 +186,9 @@ export const ParentVariableForm =
list={generateList(resources, [PARENT])}
selectedItem={ddiLabel}
onChange={(ddi) => onChange(handleSelect(resources, ddi))} />
<pre>
{JSON.stringify(parent, null, 2)}
</pre>
<br /> {/** Lol */}
<Row>
<Col xs={4}>

View File

@ -81,11 +81,10 @@ export class SequenceEditorMiddleActive extends
onChange={color => editCurrentSequence(dispatch, sequence, { color })} />
</Col>
</Row>
{shouldDisplay(Feature.variables) &&
<LocalsList
sequence={this.props.sequence}
resources={this.props.resources}
dispatch={this.props.dispatch} />}
<LocalsList
sequence={this.props.sequence}
resources={this.props.resources}
dispatch={this.props.dispatch} />
<hr />
</div>
<div className="sequence" id="sequenceDiv">