[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] re: tricky
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] re: tricky |
Date: |
Wed, 1 Jun 2005 17:10:43 +0200 |
User-agent: |
Mutt/1.3.22.1i |
On Wed, Jun 01, 2005 at 10:27:53PM +0800, Syan Tan wrote:
> here's a first implementation of a med record sql exporter.
:-)) This is what I had in mind !
> 1. prevent dumping "domain info" data e.g type tables , vaccination knowledge
> schemas.
> Also prevents backtracking from static data onto other xlnk_identity or
> identity
> It's hard to get a program to distinguish domain data from "instance" data ,
> without
> specifically labelling things.
> 2. cater for xlnk_identity using xfk_identity as both an alternate primary key
> and a foreign key
> 3. order the inserts in dependency order.
> - the set constraints all deferred; didn't seem to do anything , so had to
> order
> inserts.
I knew you could do it ;-)
> It uses a temp table of (table, old_id, new_id) at the start of the script,
> to remap the ids, and then "select new_id from id_remap where table=x and
> old_id
> = id" for all the key fields ).
Ha, I think that's an excellent idea !
> The script also tries to insert test_type_unified entries to ensure they
> are there before inserting the identity data, but doesn't fail if they are
> there,
> because they are not part of the transaction.
Agree.
> To test it worked, a modified run of cygwin/install_schema.sh was used which
> had no test data in it.
I just ran the *export* against the public DB at salaam and it
worked flawlessly. Didn't run the import yet, though.
Feel free to check this in !
Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346