Misc
SQL
Using the GetGalleryForDisplay stored procedure:procedure
CALL usp_galleries_GetGalleryForDisplay(
'N', -- Exclude images from result: Y or N
'N', -- Exclude videos from result: Y or N
NULL, -- Exclude artworks matching given categories from result: VARCHAR(400)
NULL, -- Include ONLY artworks matching given categories in result: VARCHAR(400)
NULL, -- Exclude artworks matching given tags from result: VARCHAR(400)
NULL, -- Include ONLY artworks matching given tags in result: VARCHAR(400)
NULL, -- Include ONLY artworks matching given search terms in result: VARCHAR(400)
NULL, -- Exclude artworks matching given search terms from result: VARCHAR(400)
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
'antsstyle', -- 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, -- 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 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, -- Includes logical operator:
NULL -- Requesting user ID: integer or NULL, the user making the gallery request
)
Get a comma-separated string with all the column names of a given table: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 \
--template DesertedChateau-Activation-Email \
--subject "Activate your Deserted Chateau account" \
--html "activation/activation.html" \
--update
Send a test activation email
sudo ./SendTestActivationEmail.sh \
--email "testuser1@desertedchateau.com" \
--activationcode 123