RoR Web Service "UnknownAttributeError" after adding new Data field

Hi Team,

I am facing RoR Web Service “UnknownAttributeError” after adding a new Data field.
I’ve checked in Web Service log whether the schema had been updated or not.
It seems like the schema had been updated properly but getting this strange error.
It only happens when I try to send a request from my Front-End app to Deployed Back-End.
If I send a request from the same Front-End to Localhost Backend, this exact same request goes through successfully. I am not sure how to handle this.
Are there any PostgreSQL DB changes or updates required after the schema change?

Feb 6 01:57:17 AM  I, [2023-02-06T09:57:17.812010 #79]  INFO -- : [1e010f87-5d19-4008-9873-5eac4b8e7f15] Completed 500 Internal Server Error in 13ms (ActiveRecord: 5.1ms | Allocations: 1649)
Feb 6 01:57:17 AM  F, [2023-02-06T09:57:17.813417 #79] FATAL -- : [1e010f87-5d19-4008-9873-5eac4b8e7f15]
Feb 6 01:57:17 AM  [1e010f87-5d19-4008-9873-5eac4b8e7f15] ActiveModel::UnknownAttributeError (unknown attribute 'population' for Property.
Feb 6 01:57:17 AM  
Feb 6 01:57:17 AM            raise UnknownAttributeError.new(self, k.to_s)
Feb 6 01:57:17 AM            ^^^^^):
Feb 6 01:57:17 AM  [1e010f87-5d19-4008-9873-5eac4b8e7f15]
Feb 6 01:57:17 AM  [1e010f87-5d19-4008-9873-5eac4b8e7f15] app/controllers/properties_controller.rb:15:in `create'

I found that PostgreSQL Schema hasn’t updated as Back-End Schema.
how could I update the PostgreSQL schema?

I’ve resolved an issue.
Just needed to ALTER the table from the PostgreSQL console.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.