Skip to content

Commit

Permalink
create attorneys and claims_agents tables
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenhinkle committed Apr 8, 2024
1 parent dd9e405 commit 9acd531
Showing 1 changed file with 67 additions and 2 deletions.
69 changes: 67 additions & 2 deletions db/migrate/20240405184242_create_orgs_reps_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,75 @@

class CreateOrgsRepsTables < ActiveRecord::Migration[7.1]
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
def change
create_table :accredited_attorneys, id: false, primary_key: :registration_number do |t|
t.string :registration_number, null: false
t.string :poa_code
t.string :first_name
t.string :middle_initial
t.string :last_name
t.string :full_name
t.string :email
t.string :phone
t.string :address_type
t.string :address_line1
t.string :address_line2
t.string :address_line3
t.string :city
t.string :country_code_iso3
t.string :country_name
t.string :county_name
t.string :county_code
t.string :international_postal_code
t.string :province
t.string :state_code
t.string :zip_code
t.string :zip_suffix
t.jsonb :raw_address
t.float :lat
t.float :long
t.geography :location, limit: { srid: 4326, type: 'st_point', geographic: true }
t.timestamps
end
add_index :accredited_attorneys, :full_name
add_index :accredited_attorneys, :location, using: :gist

create_table :accredited_claims_agents, id: false, primary_key: :registration_number do |t|
t.string :registration_number, null: false
t.string :poa_code
t.string :first_name
t.string :middle_initial
t.string :last_name
t.string :full_name
t.string :email
t.string :phone
t.string :address_type
t.string :address_line1
t.string :address_line2
t.string :address_line3
t.string :city
t.string :country_code_iso3
t.string :country_name
t.string :county_name
t.string :county_code
t.string :international_postal_code
t.string :province
t.string :state_code
t.string :zip_code
t.string :zip_suffix
t.jsonb :raw_address
t.float :lat
t.float :long
t.geography :location, limit: { srid: 4326, type: 'st_point', geographic: true }
t.timestamps
end
add_index :accredited_claims_agents, :full_name
add_index :accredited_claims_agents, :location, using: :gist

create_table :accredited_representatives, id: false, primary_key: :registration_number do |t|
t.string :registration_number, null: false
t.string :poa_code
t.string :types, array: true
t.string :first_name
t.string :middle_initial
t.string :last_name
Expand All @@ -33,7 +97,6 @@ def change
t.geography :location, limit: { srid: 4326, type: 'st_point', geographic: true }
t.timestamps
end
# rubocop:enable Metrics/MethodLength
add_index :accredited_representatives, :full_name
add_index :accredited_representatives, :location, using: :gist

Expand Down Expand Up @@ -78,4 +141,6 @@ def change
validate_foreign_key :accredited_organization_accredited_representatives, :accredited_representatives
validate_foreign_key :accredited_organization_accredited_representatives, :accredited_organizations
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/MethodLength
end

0 comments on commit 9acd531

Please sign in to comment.