Split out ability to upload flyover data from pool uploads
Tons of changes here, all in the name of quickly getting to where I can create test compliance letters.
This commit is contained in:
parent
9939434cb3
commit
ff2ec0ad14
38 changed files with 4204 additions and 233 deletions
16
db/migrations/00076_func_gen_alpha_code.sql
Normal file
16
db/migrations/00076_func_gen_alpha_code.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
CREATE OR REPLACE FUNCTION generate_alphanumeric_code(code_length INTEGER DEFAULT 8)
|
||||
RETURNS TEXT AS $$
|
||||
DECLARE
|
||||
chars TEXT := 'ABCDEFGHJKMNPQRSTUVWXYZ23456789';
|
||||
result TEXT := '';
|
||||
i INTEGER;
|
||||
BEGIN
|
||||
FOR i IN 1..code_length LOOP
|
||||
result := result || substr(chars, floor(random() * length(chars) + 1)::INTEGER, 1);
|
||||
END LOOP;
|
||||
RETURN result;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
-- +goose StatementEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue