Misc
SQL
Using the GetGalleryForDisplay stored procedure
CALL usp_galleries_GetGalleryForDisplay(
'N', -- Exclude images from result: Y or N
'N', -- Exclude videos from result: Y or N
NULL, -- Include artworks matching given categories from result: VARCHAR(400)
NULL, -- Match selection mode for include artwork categories: 'any', 'all', or NULL
NULL, -- Exclude artworks matching given categories in result: VARCHAR(400)
NULL, -- Match selection mode for exclude artwork categories: 'any', 'all', or NULL
NULL, -- Include artworks matching given tags in result: VARCHAR(400)
NULL, -- Match selection mode for include tags: 'any', 'all', or NULL
NULL, -- Exclude artworks matching given tags from result: VARCHAR(400)
NULL, -- Match selection mode for exclude tags: 'any', 'all', or NULL
NULL, -- Include artworks matching given search terms in result: VARCHAR(400)
NULL, -- Match selection mode for include search terms: 'any', 'all', or NULL
NULL, -- Exclude artworks matching given search terms from result: VARCHAR(400)
NULL, -- Match selection mode for exclude search terms: 'any', 'all', or NULL
NULL, -- Exclude reblogs if this search is for a user's follow feed: Y, N or NULL
NULL, -- Search date limit, exclude all artworks earlier than the given date, DATETIME or NULL
NULL, -- Metrics date limit, ignore all metrics earlier than the given date, DATETIME or NULL
NULL, -- Username to get profile gallery for: string or NULL
NULL, -- User following ID: integer or NULL, return only artworks from users the given user follows or reblogged by those users
NULL, -- User reblogging ID: integer or NULL, return only artworks that are reblogged by the given user ID
NULL, -- User liking ID: integer or NULL, return only artworks that are liked by the given user ID
NULL, -- Bookmark folder ID: integer or NULL, return only artworks in the given bookmark folder
NULL, -- Bookmark user ID: integer or NULL, required when specifying bookmark folder ID, must be bookmark folder's owner
NULL, -- User follow list ID: integer or NULL, return only artworks in the given user follow list
NULL, -- User follow list user ID: integer or NULL, required when specifying user follow list ID, must be the list's owner
NULL, -- User album ID: integer or NULL, return only artworks in the given album
25, -- SQL LIMIT for results, default 25
0, -- SQL OFFSET for results
NULL, -- Order by attribute: string OR NULL, see stored procedure for options for this. Default is date desc.
NULL -- User requesting own profile: Y or N, whether the request is for a user's own gallery
)
Get a comma-separated string with all the column names of a given table
SELECT GROUP_CONCAT(column_name ORDER BY ordinal_position)
FROM information_schema.columns
WHERE table_schema = 'deserted_chateau' AND table_name = 'user_artworks'
Scripts
Add or update an AWS SES email template
sudo ./AddEmailTemplate.sh \
# The relative path to the folder containing the html and JSON files for the template
--path "activation/DesertedChateau-Activation-Email" \
--update
Send a test activation email
sudo ./SendTestActivationEmail.sh \
--email "testuser1@desertedchateau.com" \
--activationcode 123