lemmy/migrations/2021-01-26-173850_default_a.../down.sql

11 lines
300 B
PL/PgSQL

CREATE OR REPLACE FUNCTION generate_unique_changeme ()
RETURNS text
LANGUAGE sql
AS $$
SELECT
'changeme_' || string_agg(substr('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789', ceil(random() * 62)::integer, 1), '')
FROM
generate_series(1, 20)
$$;