Sha256: 063e0cf06b12e2d34fce4ab2f449451b4abecd00c234ffcdf21eefe8886aaf9c

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

class CreateLesliCalendarEventSubscribers < ActiveRecord::Migration[6.0]
    def change
        table_base_structure = JSON.parse(File.read(Rails.root.join('db','structure','00000007_subscribers.json')))
        create_table :cloud_driver_event_subscribers do |t|
            table_base_structure.each do |column|
                t.send(
                    column["type"].parameterize.underscore.to_sym,
                    column["name"].parameterize.underscore.to_sym
                )
            end
            t.timestamps
        end
        add_reference :cloud_driver_event_subscribers, :users, foreign_key: true, index: { name: 'driver_event_subscribers_users' }
        add_reference :cloud_driver_event_subscribers, :cloud_driver_events, foreign_key: true, index: { name: 'driver_event_subscribers_events' }
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lesli_calendar-0.2.2 db/tables/0301110710_create_lesli_driver_event_subscribers.rb
lesli_calendar-0.2.1 db/tables/0301110710_create_lesli_driver_event_subscribers.rb