renalreg / ukrr_models

SQL Alchemy models for the UKRR Database. Also exports to RDA.
MIT License
0 stars 0 forks source link

refactor: Capitalise all column and table names #32

Closed andyatterton closed 2 weeks ago

andyatterton commented 2 weeks ago

Worth you all being aware of this. In theory, it shouldn't be breaking as I don't think SQLA cares about capitalisation (after all we have been using lower case when in fact the DB is all in upper) but I have run into issues with then matching them to entries from the RR_DATA_DEFINTION tables which list all table and column names in capital.

Hopefully you are all in agreement that the models should as much as possible reflect the tables. There are many areas where this is not the case but we can come back to that later.

George-D-S commented 2 weeks ago

In theory, it shouldn't be breaking as I don't think SQLA cares about capitalisation (after all we have been using lower case when in fact the DB is all in upper)

I think it's more correct to say that SQL Server doesn't care about capitalisation so will accept whatever it's given. When we tried the same on Oracle it didn't work ( See https://github.com/renalreg/ukrr_rda_extract/blob/6f765d6dd91c8eb6c08a711e5f6530d476dfd647/ukrdc/ukrr_extract/xml_utils.py#L20 ).

andyatterton commented 2 weeks ago

Yeah, I did notice this comment and was planning on removing it as I don't think any of our current databases care about capitalisation, but I do fear for time travelling George. I would assume though that the you that would arrive in the past having gone through the portal would do so with his memories intact.