Skip to content

Commit

Permalink
Replace all instances of mysql clients with mariadb clients, fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlLevik committed Jan 25, 2024
1 parent 4274212 commit 7139196
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 210 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Alternatively, do it manually:
Run this on the command-line to create a database and import the schema stored in the SQL files:

```bash
mysql -e "CREATE DATABASE ispyb"
mysql ispyb < schemas/ispyb/tables.sql
mysql ispyb < schemas/ispyb/lookups.sql
mysql ispyb < schemas/ispyb/data.sql
mysql ispyb < schemas/ispyb/routines.sql
mariadb -e "CREATE DATABASE ispyb"
mariadb ispyb < schemas/ispyb/tables.sql
mariadb ispyb < schemas/ispyb/lookups.sql
mariadb ispyb < schemas/ispyb/data.sql
mariadb ispyb < schemas/ispyb/routines.sql
```

Note that the `data.sql` file contains test data, so is only useful in a development environment.
Expand All @@ -40,15 +40,15 @@ Note that the `data.sql` file contains test data, so is only useful in a develop
Then apply the grants:

```bash
mysql ispyb < grants/ispyb_acquisition.sql
mysql ispyb < grants/ispyb_import.sql
mysql ispyb < grants/ispyb_processing.sql
mysql ispyb < grants/ispyb_ro_nopii.sql
mysql ispyb < grants/ispyb_scripts_processing.sql
mysql ispyb < grants/ispyb_ssx_writer.sql
mysql ispyb < grants/ispyb_touchscreen.sql
mysql ispyb < grants/ispyb_web.sql
mysql ispyb < grants/ispyb_web_verify_tests.sql
mariadb ispyb < grants/ispyb_acquisition.sql
mariadb ispyb < grants/ispyb_import.sql
mariadb ispyb < grants/ispyb_processing.sql
mariadb ispyb < grants/ispyb_ro_nopii.sql
mariadb ispyb < grants/ispyb_scripts_processing.sql
mariadb ispyb < grants/ispyb_ssx_writer.sql
mariadb ispyb < grants/ispyb_touchscreen.sql
mariadb ispyb < grants/ispyb_web.sql
mariadb ispyb < grants/ispyb_web_verify_tests.sql
```

Note that the grants files are based on roles, so to actually use these grants, you also need to create database users and grant the roles to them. This is described in the header section of the grant files.
Expand Down Expand Up @@ -78,17 +78,17 @@ In order to update a production database, please follow this procedure:

1. For all *.sql files in `schemas/ispyb/updates` that have not already been run, read any comments inside the files to decide if/when you should run them. Run a file e.g. like this:
```bash
mysql ispyb < schemas/ispyb/updates/2019_03_29_BLSession_archived.sql
mariadb ispyb < schemas/ispyb/updates/2019_03_29_BLSession_archived.sql
```
2. If `schemas/ispyb/routines.sql` has been updated since you installed it, you can simply re-run it. E.g.:
```bash
mysql ispyb < schemas/ispyb/routines.sql
mariadb ispyb < schemas/ispyb/routines.sql
```
3. If you ran the `routines.sql`, then re-apply the grants for the routines. E.g.:
```bash
mysql ispyb < grants/ispyb_acquisition.sql
mysql ispyb < grants/ispyb_processing.sql
mysql ispyb < grants/ispyb_web.sql
mariadb ispyb < grants/ispyb_acquisition.sql
mariadb ispyb < grants/ispyb_processing.sql
mariadb ispyb < grants/ispyb_web.sql
```

## Useful scripts
Expand Down
2 changes: 1 addition & 1 deletion bin/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ then
fi

# Note: --defaults-file must be given as first option
DUMP_W_OPTS="mysqldump --defaults-file=../.my.cnf --add-drop-table --create-options --disable-keys --extended-insert --skip-add-locks --quick --set-charset --single-transaction --max_allowed_packet=1G --default-character-set=utf8 --skip-comments --skip-dump-date"
DUMP_W_OPTS="mariadb-dump --defaults-file=../.my.cnf --add-drop-table --create-options --disable-keys --extended-insert --skip-add-locks --quick --set-charset --single-transaction --max_allowed_packet=1G --default-character-set=utf8 --skip-comments --skip-dump-date"

${DUMP_W_OPTS} --skip-triggers --no-data "${DB}" | sed -e 's/DEFINER=[^*]*\*/SQL SECURITY INVOKER \*/' | sed 's/ AUTO_INCREMENT=[0-9]*\b//g' > ${OUT_DIR}/tables.sql

Expand Down
2 changes: 1 addition & 1 deletion bin/db_procs_to_rst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ db=$1
file=$(mktemp /tmp/tsv.XXXXXX)

# Execute the sql to generate the csv outfile
mysql --defaults-file=../.my.cnf --skip-column-names --batch --raw -D $db < sql/db_procs_to_tsv.sql > ${file}
mariadb --defaults-file=../.my.cnf --skip-column-names --batch --raw -D $db < sql/db_procs_to_tsv.sql > ${file}

# Construct rst file with csv table
echo ".. csv-table:: Procedure signatures with comments"
Expand Down
2 changes: 1 addition & 1 deletion bin/db_tables_to_rst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ db=$1

file=$(mktemp /tmp/tsv.XXXXXX)

mysql --defaults-file=../.my.cnf -D $db --skip-column-names --batch --raw < sql/db_tables_to_tsv.sql > ${file}
mariadb --defaults-file=../.my.cnf -D $db --skip-column-names --batch --raw < sql/db_tables_to_tsv.sql > ${file}
sed -i 's/\t/,/g' ${file}

echo ".. csv-table:: Tables, columns and comments"
Expand Down
206 changes: 103 additions & 103 deletions bin/export_session.sh

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions bin/forget_all_labs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ DB=$2
PROPOSAL=$3
SESSNUM=$4

PID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`
SID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`
PERSID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT personId FROM Proposal WHERE proposalId=${PID};"`
LABID=`mysql --defaults-extra-file=${MYCNF} -s -D ${DB} -e "SELECT laboratoryId FROM Person WHERE personId=${PERSID};"`
PID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`
SID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`
PERSID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT personId FROM Proposal WHERE proposalId=${PID};"`
LABID=`mariadb --defaults-extra-file=${MYCNF} -s -D ${DB} -e "SELECT laboratoryId FROM Person WHERE personId=${PERSID};"`

LABIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT laboratoryId FROM Laboratory WHERE laboratoryId=${LABID} OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN LabContact lc USING(personId) WHERE lc.proposalId=${PID}) OR laboratoryId IN (SELECT laboratoryId FROM Person p INNER JOIN Session_has_Person shp USING(personId) WHERE shp.sessionId=${SID}) OR laboratoryId IN (SELECT laboratoryId FROM Person p INNER JOIN ProposalHasPerson php USING(personId) WHERE php.proposalId=${PID}) OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN Container c ON c.ownerId=p.personId WHERE c.sessionId=${SID}) OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN Container c ON c.ownerId=p.personId INNER JOIN Dewar d USING(dewarId) INNER JOIN Shipping s USING(shippingId) WHERE s.proposalId=${PID}) OR laboratoryId IN (SELECT pe.laboratoryId FROM Person pe INNER JOIN Container c ON c.ownerId=pe.personId INNER JOIN BLSample bls USING(containerId) INNER JOIN Crystal USING(crystalId) INNER JOIN Protein p USING(proteinId) WHERE p.proposalId=${PID}) OR laboratoryId IN (SELECT pe.laboratoryId FROM Person pe INNER JOIN Shipping s ON pe.personId=s.deliveryAgent_flightCodePersonId WHERE s.proposalId=${PID})"`
LABIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT laboratoryId FROM Laboratory WHERE laboratoryId=${LABID} OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN LabContact lc USING(personId) WHERE lc.proposalId=${PID}) OR laboratoryId IN (SELECT laboratoryId FROM Person p INNER JOIN Session_has_Person shp USING(personId) WHERE shp.sessionId=${SID}) OR laboratoryId IN (SELECT laboratoryId FROM Person p INNER JOIN ProposalHasPerson php USING(personId) WHERE php.proposalId=${PID}) OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN Container c ON c.ownerId=p.personId WHERE c.sessionId=${SID}) OR laboratoryId IN (SELECT p.laboratoryId FROM Person p INNER JOIN Container c ON c.ownerId=p.personId INNER JOIN Dewar d USING(dewarId) INNER JOIN Shipping s USING(shippingId) WHERE s.proposalId=${PID}) OR laboratoryId IN (SELECT pe.laboratoryId FROM Person pe INNER JOIN Container c ON c.ownerId=pe.personId INNER JOIN BLSample bls USING(containerId) INNER JOIN Crystal USING(crystalId) INNER JOIN Protein p USING(proteinId) WHERE p.proposalId=${PID}) OR laboratoryId IN (SELECT pe.laboratoryId FROM Person pe INNER JOIN Shipping s ON pe.personId=s.deliveryAgent_flightCodePersonId WHERE s.proposalId=${PID})"`

while read -r LABID; do
`./forget_lab.sh ${MYCNF} ${DB} ${LABID}`
Expand Down
6 changes: 3 additions & 3 deletions bin/forget_all_persons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ SESSNUM=$4

# Get the proposal PID and the session SID:

PID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`
SID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`
PID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`
SID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`

# Get all personIds related to the PID and SID
PERSIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT personId FROM Proposal WHERE proposalId=${PID} UNION SELECT personId FROM Person WHERE personId IN (SELECT personId FROM LabContact WHERE proposalId=${PID}) OR personId IN (SELECT personId FROM Session_has_Person WHERE sessionId=${SID}) OR personId IN (SELECT personId FROM ProposalHasPerson WHERE proposalId=${PID}) OR personId IN (SELECT ownerId FROM Container WHERE sessionId=${SID}) OR personId IN (SELECT c.ownerId FROM Container c INNER JOIN Dewar d USING(dewarId) INNER JOIN Shipping s USING(shippingId) WHERE s.proposalId=${PID}) OR personId IN (SELECT c.ownerId FROM Container c INNER JOIN BLSample bls USING(containerId) INNER JOIN Crystal USING(crystalId) INNER JOIN Protein p USING(proteinId) WHERE p.proposalId=${PID}) OR personId IN (SELECT s.deliveryAgent_flightCodePersonId FROM Shipping s WHERE s.proposalId=${PID});"`
PERSIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT personId FROM Proposal WHERE proposalId=${PID} UNION SELECT personId FROM Person WHERE personId IN (SELECT personId FROM LabContact WHERE proposalId=${PID}) OR personId IN (SELECT personId FROM Session_has_Person WHERE sessionId=${SID}) OR personId IN (SELECT personId FROM ProposalHasPerson WHERE proposalId=${PID}) OR personId IN (SELECT ownerId FROM Container WHERE sessionId=${SID}) OR personId IN (SELECT c.ownerId FROM Container c INNER JOIN Dewar d USING(dewarId) INNER JOIN Shipping s USING(shippingId) WHERE s.proposalId=${PID}) OR personId IN (SELECT c.ownerId FROM Container c INNER JOIN BLSample bls USING(containerId) INNER JOIN Crystal USING(crystalId) INNER JOIN Protein p USING(proteinId) WHERE p.proposalId=${PID}) OR personId IN (SELECT s.deliveryAgent_flightCodePersonId FROM Shipping s WHERE s.proposalId=${PID});"`

# iterate over and forget:

Expand Down
2 changes: 1 addition & 1 deletion bin/forget_lab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
LABID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Laboratory SET name='lab-${LABID}', laboratoryUUID=NULL, city=NULL, address=NULL, country=NULL, url=NULL, organization=NULL, laboratoryPk=NULL, postcode=NULL WHERE laboratoryId=${LABID};"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Laboratory SET name='lab-${LABID}', laboratoryUUID=NULL, city=NULL, address=NULL, country=NULL, url=NULL, organization=NULL, laboratoryPk=NULL, postcode=NULL WHERE laboratoryId=${LABID};"
2 changes: 1 addition & 1 deletion bin/forget_pdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
PDBID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE PDB SET name=pdbId, contents=NULL, code=NULL WHERE pdbId=${PDBID};"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE PDB SET name=pdbId, contents=NULL, code=NULL WHERE pdbId=${PDBID};"
4 changes: 2 additions & 2 deletions bin/forget_person.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ MYCNF=$1
DB=$2
PERSONID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Person SET familyName='Doe', givenName='John', title=NULL, emailAddress='hello@example.com', phoneNumber=NULL, login='john-${PERSONID}', faxNumber=NULL, cache=NULL, externalId=NULL WHERE personId='${PERSONID}';"
mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE LabContact SET cardName=concat('Doe', labContactId), defaultCourrierCompany='Doe', courierAccount='12345', billingReference=NULL, dewarAvgCustomsValue=0, dewarAvgTransportValue=0 WHERE personId='${PERSONID}';"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Person SET familyName='Doe', givenName='John', title=NULL, emailAddress='hello@example.com', phoneNumber=NULL, login='john-${PERSONID}', faxNumber=NULL, cache=NULL, externalId=NULL WHERE personId='${PERSONID}';"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE LabContact SET cardName=concat('Doe', labContactId), defaultCourrierCompany='Doe', courierAccount='12345', billingReference=NULL, dewarAvgCustomsValue=0, dewarAvgTransportValue=0 WHERE personId='${PERSONID}';"
2 changes: 1 addition & 1 deletion bin/forget_protein.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
PROTEINID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Protein SET name='prot-${PROTEINID}', acronym='prot-${PROTEINID}', safetyLevel='GREEN', molecularMass=NULL, proteinType=NULL, sequence=NULL, componentTypeId=NULL, concentrationTypeId=NULL, externalId=NULL, density=NULL, abundance=NULL WHERE proteinId=${PROTEINID};"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Protein SET name='prot-${PROTEINID}', acronym='prot-${PROTEINID}', safetyLevel='GREEN', molecularMass=NULL, proteinType=NULL, sequence=NULL, componentTypeId=NULL, concentrationTypeId=NULL, externalId=NULL, density=NULL, abundance=NULL WHERE proteinId=${PROTEINID};"
2 changes: 1 addition & 1 deletion bin/forget_sample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
BLSAMPLEID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE BLSample SET name='s-${BLSAMPLEID}', code='c-${BLSAMPLEID}', comments=NULL WHERE blSampleId='${BLSAMPLEID}';"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE BLSample SET name='s-${BLSAMPLEID}', code='c-${BLSAMPLEID}', comments=NULL WHERE blSampleId='${BLSAMPLEID}';"
2 changes: 1 addition & 1 deletion bin/forget_shipping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
SHIPPINGID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Shipping SET shippingName='s-${SHIPPINGID}', comments=NULL, SAFETYLEVEL=NULL, deliveryAgent_agentCode=NULL, deliveryAgent_flightCode=NULL, deliveryAgent_label=NULL, deliveryAgent_productcode=NULL WHERE shippingId='${SHIPPINGID}';"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE Shipping SET shippingName='s-${SHIPPINGID}', comments=NULL, SAFETYLEVEL=NULL, deliveryAgent_agentCode=NULL, deliveryAgent_flightCode=NULL, deliveryAgent_label=NULL, deliveryAgent_productcode=NULL WHERE shippingId='${SHIPPINGID}';"
2 changes: 1 addition & 1 deletion bin/forget_subsample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MYCNF=$1
DB=$2
BLSUBSAMPLEID=$3

mysql --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE BLSubSample SET comments=NULL WHERE blSubSampleId='${BLSUBSAMPLEID}';"
mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "UPDATE BLSubSample SET comments=NULL WHERE blSubSampleId='${BLSUBSAMPLEID}';"
14 changes: 7 additions & 7 deletions bin/forget_unused_shipments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ SESSNUM=$4

# Get the proposal PID:

PID=`mysql --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`
PID=`mariadb --defaults-file=${MYCNF} -s -D ${DB} -e "SELECT proposalId FROM Proposal WHERE concat(proposalCode, proposalNumber)='${PROPOSAL}';"`

SID=`mysql --defaults-extra-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`
SID=`mariadb --defaults-extra-file=${MYCNF} -s -D ${DB} -e "SELECT sessionId FROM BLSession WHERE proposalId='${PID}' AND visit_number=${SESSNUM};"`

# Query to find all shippingIds of all used samples and sub-samples
# on the session. Beware of NULLs!
Expand Down Expand Up @@ -69,7 +69,7 @@ WHERE s.proposalId=${PID}
${SHIPPINGID_USED_SELECT}
)"

SHIPPINGIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${SHIPPINGID_UNUSED_SELECT};"`
SHIPPINGIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${SHIPPINGID_UNUSED_SELECT};"`

# Iterate over shippings and forget:

Expand All @@ -92,7 +92,7 @@ FROM (
GROUP BY bls.blSampleId) q1
WHERE q1.cnt1=0 AND q1.cnt2=0 AND q1.cnt3=0"

BLSAMPLEIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${BLSAMPLE_UNUSED_SELECT};"`
BLSAMPLEIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${BLSAMPLE_UNUSED_SELECT};"`

# Iterate over samples and forget:

Expand All @@ -117,7 +117,7 @@ FROM (
GROUP BY blss.blSubSampleId) q2
WHERE q2.cnt1=0 AND q2.cnt2=0 AND q2.cnt3=0"

BLSUBSAMPLEIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${BLSUBSAMPLE_UNUSED_SELECT};"`
BLSUBSAMPLEIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "${BLSUBSAMPLE_UNUSED_SELECT};"`

# Iterate over sub-samples and forget:

Expand All @@ -127,7 +127,7 @@ done <<< "${BLSUBSAMPLEIDS}"

# Query to find all unused proteins on the proposal

PROTEINIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT p.proteinId
PROTEINIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT p.proteinId
FROM Protein p
LEFT JOIN Crystal c USING(proteinId)
LEFT JOIN BLSample bls USING(crystalId)
Expand All @@ -147,7 +147,7 @@ done <<< "${PROTEINIDS}"

# Query to find all unused PDBs on the proposal

PDBIDS=`mysql --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT phpdb.pdbId
PDBIDS=`mariadb --defaults-file=${MYCNF} -D ${DB} --skip-column-names --silent --raw -e "SELECT phpdb.pdbId
FROM Protein_has_PDB phpdb
JOIN Protein p USING(proteinId)
WHERE p.proposalId=${PID}
Expand Down
2 changes: 1 addition & 1 deletion bin/missed_updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source ${project_root}/bin/functions.sh
all_sql_files=`cd ${project_root}/schemas/ispyb/updates && ls *.sql && cd ../..`

# Get a list of all update files recorded in the SchemaStatus table
done_sql_files=`mysql --defaults-file=${project_root}/.my.cnf -D $DB --skip-column-names --silent --raw -e "SELECT scriptName FROM SchemaStatus WHERE schemaStatus = 'DONE' ORDER BY recordTimeStamp;"`
done_sql_files=`mariadb --defaults-file=${project_root}/.my.cnf -D $DB --skip-column-names --silent --raw -e "SELECT scriptName FROM SchemaStatus WHERE schemaStatus = 'DONE' ORDER BY recordTimeStamp;"`

# Make a list of all update files not recorded in the SchemaStatus table
arr=()
Expand Down
Loading

0 comments on commit 7139196

Please sign in to comment.