mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
Update migration
This commit is contained in:
parent
c8733c2d7f
commit
f37bedb86b
2 changed files with 3 additions and 3 deletions
|
|
@ -39,10 +39,8 @@ class TripsController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
# Handle sharing settings update
|
||||
handle_sharing_update if params[:sharing]
|
||||
|
||||
# Handle regular trip update
|
||||
if @trip.update(trip_params)
|
||||
redirect_to @trip, notice: 'Trip was successfully updated.', status: :see_other
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSharingToTrips < ActiveRecord::Migration[8.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_column :trips, :sharing_uuid, :uuid
|
||||
add_column :trips, :sharing_settings, :jsonb, default: {}
|
||||
add_index :trips, :sharing_uuid, unique: true
|
||||
add_index :trips, :sharing_uuid, unique: true, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue