Update visited_countries column type to jsonb

This commit is contained in:
Eugene Burmakin 2025-05-16 21:29:07 +02:00
parent 52fe105230
commit c681fdbdb6
4 changed files with 8 additions and 4 deletions

View file

@ -2,6 +2,10 @@
class AddVisitedCountriesToTrips < ActiveRecord::Migration[8.0]
def change
add_column :trips, :visited_countries, :jsonb, default: []
safety_assured do
execute <<-SQL
ALTER TABLE trips ADD COLUMN visited_countries JSONB DEFAULT '{}'::jsonb NOT NULL;
SQL
end
end
end

2
db/schema.rb generated
View file

@ -224,7 +224,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_15_192211) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.geometry "path", limit: {srid: 3857, type: "line_string"}
t.jsonb "visited_countries", default: []
t.jsonb "visited_countries", default: {}, null: false
t.index ["user_id"], name: "index_trips_on_user_id"
end

View file

@ -25,7 +25,7 @@ RUN apk -U add --no-cache \
less \
yaml-dev \
gcompat \
libgeos-dev \
geos \
&& mkdir -p $APP_PATH
# Update gem system and install bundler

View file

@ -22,7 +22,7 @@ RUN apk -U add --no-cache \
less \
yaml-dev \
gcompat \
libgeos-dev \
geos \
&& mkdir -p $APP_PATH
# Update gem system and install bundler