DO $$
BEGIN
    IF to_regclass('user_pass') IS NULL THEN
        CREATE VIEW user_pass AS
        SELECT
            "user",
            hash,
            salt,
            is_active,
            reason,
            created_at,
            updated_at
        FROM user_password;
    END IF;
END $$;
