Stephen Oberauer
Stephen Oberauer

Reputation: 5385

How can I specify a multi-line property value in a Flyway DB configuration file?

I'm trying to put a PGP encryption key into a Flyway DB configuration file. Something like this:

# Encryption key for encrypting stuff
flyway.placeholders.encryptionKey=-----BEGIN PGP PUBLIC KEY BLOCK-----  
Version: BCPG C# v1.2.3.4    

mQEGBFRgnDEBCACi4yRYnmLtgEBoXfx+YYwZ1b6xPRN5oZBqp76YGPwtVfNGOzpK
JKclFD1uIr/MIQZB89G2Z4gJB/q2E+CNbHUGc/bxU8DpGOOo3DsN2UP2xxz41sRY
7eW0SiSSIw2Cu+4dG3Ic+pBv8pxUFZDCyGCtENucfoxKe3J69IWNbBRCiftndW2A
Wf7vPyrygcD+9Ju/7OrLL7FnWJ66TZk6DUgjMm1c4J4ZoyHRfZHEvhx/j2OlxzIV
ysHXThyrVZzkO0sA0kobzJEfdpKhRg==
=SpNy
-----END PGP PUBLIC KEY BLOCK-----  

I'm then using the property in an update SQL script, e.g.

UPDATE [MyTable] SET [MyColumn] = '${encryptionKey}'

When I run the update it simply updates with the first line of the key. Is there a way to specify multi-line properties in a Flyway configuration file?

Upvotes: 0

Views: 259

Answers (1)

Stephen Oberauer
Stephen Oberauer

Reputation: 5385

One has to add \n\ to the end of each line, like this:

# Encryption key for encrypting stuff
flyway.placeholders.encryptionKey=-----BEGIN PGP PUBLIC KEY BLOCK-----  \n\
Version: BCPG C# v1.2.3.4    \n\
\n\
mQEGBFRgnDEBCACi4yRYnmLtgEBoXfx+YYwZ1b6xPRN5oZBqp76YGPwtVfNGOzpK\n\
JKclFD1uIr/MIQZB89G2Z4gJB/q2E+CNbHUGc/bxU8DpGOOo3DsN2UP2xxz41sRY\n\
7eW0SiSSIw2Cu+4dG3Ic+pBv8pxUFZDCyGCtENucfoxKe3J69IWNbBRCiftndW2A\n\
Wf7vPyrygcD+9Ju/7OrLL7FnWJ66TZk6DUgjMm1c4J4ZoyHRfZHEvhx/j2OlxzIV\n\
ysHXThyrVZzkO0sA0kobzJEfdpKhRg==\n\
=SpNy\n\
-----END PGP PUBLIC KEY BLOCK-----  

Upvotes: 2

Related Questions