by
Muhammad Reda , Senior Drupal Developer and Problem Solver , MESC
Take a look at Schema module. https://drupal.org/project/schema
The Schema API allows modules to declare their database tables in a structured array and provides API functions for creating, dropping, and changing tables, columns, keys, and indexes.