-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.6.0.6765
-- --------------------------------------------------------



-- Dumping database structure for db_funkc
CREATE DATABASE IF NOT EXISTS `db_funkc` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
USE `db_funkc`;

-- Dumping structure for function db_funkc.check_user_fn
DELIMITER //
CREATE FUNCTION `check_user_fn`(p_username VARCHAR(50), p_password_hash VARCHAR(255)) RETURNS tinyint(1)
    DETERMINISTIC
BEGIN
    DECLARE stored_hash VARCHAR(255);

    IF stored_hash = p_password_hash THEN
        RETURN TRUE;
    ELSE
        RETURN FALSE;
    END IF;
END//
DELIMITER ;

-- Dumping structure for function db_funkc.create_user_fn
DELIMITER //
CREATE FUNCTION `create_user_fn`(p_username VARCHAR(50), p_password_hash VARCHAR(255)) RETURNS tinyint(1)
    DETERMINISTIC
BEGIN
    DECLARE existing INT DEFAULT 0;
        RETURN TRUE;
    ELSE
        RETURN FALSE;
    END IF;
END//
DELIMITER ;
        RETURN TRUE;
    ELSE
        RETURN FALSE;
    END IF;
END//
DELIMITER ;
    ELSE
        RETURN FALSE;
    END IF;
END//
DELIMITER ;
        RETURN TRUE;
    ELSE
        RETURN FALSE;
    END IF;
END//
DELIMITER ;

