Skip to content

Commit

Permalink
Extend column width farmware_envs.value
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Feb 10, 2021
1 parent c58b2f2 commit 9b8036a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20210210144434_extend_farmware_env_value_column.rb
@@ -0,0 +1,5 @@
class ExtendFarmwareEnvValueColumn < ActiveRecord::Migration[6.1]
def change
change_column :farmware_envs, :value, :string, limit: 1000
end
end
5 changes: 3 additions & 2 deletions db/structure.sql
Expand Up @@ -412,7 +412,7 @@ CREATE TABLE public.farmware_envs (
id bigint NOT NULL,
device_id bigint,
key character varying(100),
value character varying(300),
value character varying(1000),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
Expand Down Expand Up @@ -3521,6 +3521,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20201211161018'),
('20201216101103'),
('20210107224804'),
('20210201145935');
('20210201145935'),
('20210210144434');


5 changes: 2 additions & 3 deletions spec/models/farmware_envs_spec.rb
Expand Up @@ -5,9 +5,8 @@
p = {
device: FactoryBot.create(:device),
key: Faker::Games::Pokemon.name,
value: "===" * 300
value: "===" * 334
}
expect { FarmwareEnv.create!(p) }
.to raise_error(ActiveRecord::ValueTooLong)
expect { FarmwareEnv.create!(p) }.to raise_error(ActiveRecord::ValueTooLong)
end
end

0 comments on commit 9b8036a

Please sign in to comment.