I have my custom module myCustomModule
in drupal 7
website along with installation file to create table.
I Have already saved lot of content in table but I need to create a new table in same module without affecting the previous table data.
if I add something new in .INSTALL file
, I have to uninstall and install module which will remove the existing data content from my table.
Is there a way to create new table for existing module without affecting existing table data.
How do I update my module structure without affecting previous things.
[or last option for me is to create a new module and have separate table but I dont want to create so many modules ]
Please help , I need to do it for Drupal 7
EDIT
I followed this link and tried below and cleared cache after updating my code
/**
* Create new database table {new_table}.
*/
function my_module_update_7101() {
$schema['new_table'] = array(
'description' => 'Table for storing information about static media asset .',
'fields' => array(
'aid' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique aggregator static media asset ID.',
),
'asset_title' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Title of the static media asset title',
),
'asset_file_path' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'CDN url path for asset.',
),
'status' => array(
'description' => 'status field for the static media assets',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
'default' => 1,
),
),
'primary key' => array('aid'),
);
db_create_table('new_table', $schema['new_table']);
}
It does not seem to update my table