Since campsite types need a media, i have to insert also images to the media relation. The best would be to use PostgreSQL’s pg_read_binary_file to read the media content from actual files when inserting the new rows, but the files need to be within the database cluster directory, or have to use an absolute path when running as a superuser to read from files outside the cluster directory, which means that it would depend on the path where i leave the files, that is different in development that in staging. To avoid that problem i can simply insert the rows using their base64 strings, with PostgreSQL’s decode. The images are kind of small, but i was worried that each change in demo.sql would duplicate that data in git, even if the change is not related to the images, because git stores the whole file; even if small, soon everything adds up. I do not care if the _final_ demo.sql is big, as this file is packaged in a different deb and is only installed in staging, so i’ve chosen to use m4 to build a single “amalgamated” SQL file from the base .sql file and the individual image files converted to base64 strings. That way, each image is individually managed by git and the base .sql file does not balloon up for each little change. Changed m4’s quotes to [[ ]] because the default ` ' was interfering with Intellij’s syntax highlighting.
5 lines
37 B
Plaintext
5 lines
37 B
Plaintext
/.idea/
|
|
/locale/
|
|
/po/*.pot
|
|
/demo.sql
|