Skip to content

Commit

Permalink
Enable spread by default, disable encoders by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed May 15, 2019
1 parent a3e07b7 commit b8c84fc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 8 additions & 0 deletions db/migrate/20190515185612_update_a_few_column_defaults.rb
@@ -0,0 +1,8 @@
class UpdateAFewColumnDefaults < ActiveRecord::Migration[5.2]
def change
change_column_default(:firmware_configs, :encoder_enabled_x, from: 1, to: 0)
change_column_default(:firmware_configs, :encoder_enabled_y, from: 1, to: 0)
change_column_default(:firmware_configs, :encoder_enabled_z, from: 1, to: 0)
change_column_default(:web_app_configs, :show_spread, from: false, to: true)
end
end
11 changes: 6 additions & 5 deletions db/structure.sql
Expand Up @@ -468,9 +468,9 @@ CREATE TABLE public.firmware_configs (
device_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
encoder_enabled_x integer DEFAULT 1,
encoder_enabled_y integer DEFAULT 1,
encoder_enabled_z integer DEFAULT 1,
encoder_enabled_x integer DEFAULT 0,
encoder_enabled_y integer DEFAULT 0,
encoder_enabled_z integer DEFAULT 0,
encoder_invert_x integer DEFAULT 0,
encoder_invert_y integer DEFAULT 0,
encoder_invert_z integer DEFAULT 0,
Expand Down Expand Up @@ -1518,7 +1518,7 @@ CREATE TABLE public.web_app_configs (
map_xl boolean DEFAULT false,
raw_encoders boolean DEFAULT false,
scaled_encoders boolean DEFAULT false,
show_spread boolean DEFAULT false,
show_spread boolean DEFAULT true,
show_farmbot boolean DEFAULT true,
show_plants boolean DEFAULT true,
show_points boolean DEFAULT true,
Expand Down Expand Up @@ -2966,6 +2966,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20190502163453'),
('20190504170018'),
('20190512015442'),
('20190513221836');
('20190513221836'),
('20190515185612');


Expand Up @@ -13,9 +13,9 @@
device.firmware_config.destroy! # Let's test defaults.
get :show, format: :json
expect(response.status).to eq(200)
{ encoder_enabled_x: 1,
encoder_enabled_y: 1,
encoder_enabled_z: 1,
{ encoder_enabled_x: 0,
encoder_enabled_y: 0,
encoder_enabled_z: 0,
encoder_invert_x: 0,
encoder_invert_y: 0,
encoder_invert_z: 0,
Expand Down
Expand Up @@ -24,7 +24,7 @@
map_xl: false,
raw_encoders: false,
scaled_encoders: false,
show_spread: false,
show_spread: true,
show_farmbot: true,
show_plants: true,
show_points: true,
Expand Down

0 comments on commit b8c84fc

Please sign in to comment.