Skip to content

add unique constraints to stop client_* tables from growing out of bounds#1313

Open
bodewig wants to merge 1 commit intomitreid-connect:masterfrom
bodewig:stop_client_table_growth
Open

add unique constraints to stop client_* tables from growing out of bounds#1313
bodewig wants to merge 1 commit intomitreid-connect:masterfrom
bodewig:stop_client_table_growth

Conversation

@bodewig
Copy link
Contributor

@bodewig bodewig commented Nov 2, 2017

In our dev environments where we provision clients via a clients.sql script three of the client_ grew with every service restart. The reason is the code assumes entries in that table to be unique while in fact they are not (at the DB level).

I've added unique constraints for postgres and mysql only as I think the merge commands used for hsql and oracle should already avoid growing those tables.

@codecov-io
Copy link

Codecov Report

Merging #1313 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1313   +/-   ##
========================================
  Coverage      23.7%   23.7%           
  Complexity      849     849           
========================================
  Files           209     209           
  Lines         11664   11664           
  Branches       2116    2116           
========================================
  Hits           2765    2765           
  Misses         8422    8422           
  Partials        477     477

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce9bf35...c4ff5f8. Read the comment docs.

@jricher
Copy link
Member

jricher commented Nov 2, 2017

The clients.sql and associated MERGE statements aren't really meant to be used with persistent databases, they're really only there to bootstrap systems such as the in-memory HSQL database. We've considered dropping all the MERGE stuff entirely now that we have an import/export function that can be used to get data into the server, and use a simple pre-loaded table for HSQL only.

This pull request looks fine on its own though, as these constraints make sense. We try to not change the table schema within a release but this is additive and should be ok to get in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants