Skip to content

Commit

Permalink
Change json datatype to jsonb
Browse files Browse the repository at this point in the history
Signed-off-by: Clemens Gruber <[email protected]>
  • Loading branch information
clemensg committed May 14, 2015
1 parent e66a305 commit af42013
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Unreleased
- Fixed a bug in the offset calculation of `.enqueue_at`.
- Changed the args column datatype from json to jsonb

Version 3.0.0rc
- Improved signal handling
Expand Down
6 changes: 3 additions & 3 deletions sql/create_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ CREATE TABLE queue_classic_jobs (
scheduled_at timestamptz default now()
);

-- If json type is available, use it for the args column.
perform * from pg_type where typname = 'json';
-- If jsonb type is available, use it for the args column.
perform * from pg_type where typname = 'jsonb';
if found then
alter table queue_classic_jobs alter column args type json using (args::json);
alter table queue_classic_jobs alter column args type jsonb using (args::jsonb);
end if;

end $$ language plpgsql;
Expand Down

0 comments on commit af42013

Please sign in to comment.