Sha256: 4a67dea7fa58731b5a79ddb31e8196c2d6ca1cc448eadc7c8805dcd31bc5756b

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

class CreateCloudDriverEventFiles < ActiveRecord::Migration[6.0]
    def change
        table_base_structure = JSON.parse(File.read(Rails.root.join('db','structure','00000006_files.json')))
        create_table :cloud_driver_event_files 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_files, :users, foreign_key: true
        add_reference :cloud_driver_event_files, :cloud_driver_events, foreign_key: true
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lesli_driver-0.2.0 db/tables/0301110610_create_lesli_driver_event_files.rb
lesli_driver-0.1.0 db/tables/0301110610_create_lesli_driver_event_files.rb