-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding primary keys to tables #2
Comments
Ok @isedwards I will look through. |
Thank you Samuel |
Noting #1: The table below lists every table in the Climsoft 4.1.1 schema that currently does not explicitly define a primary key. The "Candidate Primary Key" gives the current For completeness, the third column compares this analysis to the attached primary keys summary:
|
In the list of tables without primary keys, there are several named "aws_xxxxx" where the xxxxx looks like a country or group (Malawi, Rwanda, REMA). It looks as though these are either temporary tables created during the setup of station details or they are used in processing automatic weather station reports from the named country or group. Either way, these probably should not be in the distribution database. |
@Steve-Palmer you're right about these tables. The "aws_xx.." tables are created at run time whenever a new AWS data structure is introduced in Climsoft operation. Those listed by @isedwards have been left as samples in the distribution database as a demonstration on how a new AWS data structure should be constructed. |
@smachua could you look through the Climsoft database for tables that don't currently have primary keys and suggest which fields can make up the primary keys? In many cases these already have unique indices.
We can then create a script with
ALTER TABLE table_name ADD primary key (field1, field2, ...)
commands as part of the next database update.The text was updated successfully, but these errors were encountered: