Sha256: c08dd866c449304087746cf76277bf6e40366eb790fd6a7655ee6e75ebea4a07

Contents?: true

Size: 985 Bytes

Versions: 1

Compression:

Stored size: 985 Bytes

Contents

class CreateCloudHelpTicketDiscussions < ActiveRecord::Migration[6.0]
    def change
        table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000005_discussions.json")))
        create_table :cloud_help_ticket_discussions 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_help_ticket_discussions, :cloud_help_ticket_discussions, foreign_key: true, index: { name: "help_ticket_discussions_discussions" }
        add_reference :cloud_help_ticket_discussions, :users, foreign_key: true, index: { name: "help_ticket_discussions_users" }
        add_reference :cloud_help_ticket_discussions, :cloud_help_tickets, foreign_key: true, index: { name: "help_ticket_discussions_tickets" }
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lesli_help-0.1.0 db/tables/0702100510_create_cloud_help_ticket_discussions.rb