add requirements for column and refactor db.php code