Skip to content

Commit

Permalink
bug(besu): update sql statements for mysql 8.0+ version
Browse files Browse the repository at this point in the history
Signed-off-by: alvaro.picazo.haase <[email protected]>
  • Loading branch information
alvaropicazo committed Jan 17, 2025
1 parent 24567ee commit 5a1272e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,17 @@ spec:
# create an SQL script file
# This SQL script updates user passwords and creates database tables
# root user is being created for '%' host
cat << EOF > /docker-entrypoint-initdb.d/createTables.sql
UPDATE mysql.user SET authentication_string = PASSWORD('$pass') WHERE User = 'demouser';
UPDATE mysql.user SET authentication_string = PASSWORD('$pass') WHERE User = 'root';
CREATE USER'root'@'%' IDENTIFIED BY '$pass';
ALTER USER 'demouser'@'%' IDENTIFIED BY '$pass';
CREATE TABLE IF NOT EXISTS ENCRYPTED_TRANSACTION (ENCODED_PAYLOAD BLOB NOT NULL, HASH VARBINARY(100) NOT NULL, TIMESTAMP BIGINT, PRIMARY KEY (HASH));
CREATE TABLE IF NOT EXISTS PRIVACY_GROUP(ID VARBINARY(100) NOT NULL, LOOKUP_ID BLOB NOT NULL, DATA BLOB NOT NULL, TIMESTAMP BIGINT, PRIMARY KEY (ID));
CREATE TABLE IF NOT EXISTS ENCRYPTED_RAW_TRANSACTION (ENCRYPTED_KEY BLOB NOT NULL, ENCRYPTED_PAYLOAD BLOB NOT NULL, NONCE BLOB NOT NULL, SENDER BLOB NOT NULL, TIMESTAMP BIGINT, HASH VARBINARY(100) NOT NULL, PRIMARY KEY (HASH));
CREATE TABLE ST_TRANSACTION(ID BIGINT(19) NOT NULL, HASH VARCHAR(100) NOT NULL, PAYLOAD BLOB, PRIVACY_MODE BIGINT(10), TIMESTAMP BIGINT(19), VALIDATION_STAGE BIGINT(19), PRIMARY KEY (ID));
CREATE TABLE ST_AFFECTED_TRANSACTION(ID BIGINT(19) NOT NULL, AFFECTED_HASH VARCHAR(100) NOT NULL, TXN_ID BIGINT(19) NOT NULL, CONSTRAINT FK_ST_AFFECTED_TRANSACTION_TXN_ID FOREIGN KEY (TXN_ID) REFERENCES ST_TRANSACTION(ID), PRIMARY KEY (ID));
CREATE INDEX IF NOT EXISTS ST_TRANSACTION_VALSTG ON ST_TRANSACTION(VALIDATION_STAGE);
CREATE INDEX ST_TRANSACTION_VALSTG ON ST_TRANSACTION(VALIDATION_STAGE);
EOF
volumeMounts:
- name: mysql
Expand Down

0 comments on commit 5a1272e

Please sign in to comment.