health-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health-dev] Health Specialty: Key (specialty)=(32) is not present i


From: ronald munjoma
Subject: Re: [Health-dev] Health Specialty: Key (specialty)=(32) is not present in table "gnuhealth_hp_specialty".
Date: Thu, 15 Aug 2013 16:41:03 +0200

Hi Luis,
On Aug 11, 2013 1:28 AM, "Luis Falcon" <address@hidden> wrote:
>
> Dear Ronald
> On 07/08/2013 07:18, ronald munjoma wrote:
> > Dear All,
> >
> > I tried to update my local install to test the GNU Health professional
> > auto fill functionality and I am getting the below trace back
> >
> > [Tue Aug 06 15:43:13 2013] ERROR:sql:Wrong SQL: ALTER TABLE
> > "gnuhealth_physician" ADD FOREIGN KEY ("specialty") REFERENCES
> > "gnuhealth_hp_specialty" ON DELETE SET NULL
> > Traceback (most recent call last):
> >   File "./trytond", line 109, in <module>
> >     trytond.server.TrytonServer(options).run()
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/server.py",
> > line 131, in run
> >     Pool(db_name).init(update=update, lang=lang)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/pool.py", line
> > 134, in init
> >     lang=lang)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/modules/__init__.py",
> > line 391, in load_modules
> >     load_module_graph(graph, pool, lang)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/modules/__init__.py",
> > line 229, in load_module_graph
> >     cls.__register__(module)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/model/modelsql.py",
> > line 151, in __register__
> >     table.add_fk(field_name, ref, field.ondelete)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/backend/postgresql/table.py",
> > line 301, in add_fk
> >     'ON DELETE ' + on_delete)
> >   File
> > "/home/ronald/.local/lib/python2.7/site-packages/trytond/backend/postgresql/database.py",
> > line 308, in execute
> >     res = self.cursor.execute(sql)
> > psycopg2.IntegrityError: insert or update on table "gnuhealth_physician"
> > violates foreign key constraint "gnuhealth_physician_specialty_fkey"
> > DETAIL:  Key (specialty)=(32) is not present in table
> > "gnuhealth_hp_specialty".
> >
> Try to update to the latest (rev. 931 ) trunk. From there, update a 2.0
> DB and let me know if it works.

I did the upgrade and it worked. Still to do more testing. I will post if I come across any issues.

Thanks and Regards
Ronald Munjoma
>
> The __register__ method will insert the specialty of each health worker
> into the new table of specialties associated to health professionals.
>
> I did an upgrade and it seems to be OK, but more testing needs to be done.
>
> Best,
>
> > Thanks and Regards
> > Ronald Munjoma
> >
>
>
> --
> Luis Falcon
> http://health.gnu.org
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]