1

I have created new feature and needs to add .install file to create new table like create new module way

but the table have not been created

can you advice me with the right way to do or i have to create a new module along with the feature thanks in advance

0

1 Answer 1

3

If you stay out of the files that Features generated, you can add code to the (Features generated) module the way you normally do things.

The problem is that your module is already installed when you're adding the schema via .install. You'll need to implement hook_update_N and add the tables using db_create_table. Run update.php or drush updatedb and your schema should be created.

2
  • but as u say if i put hook_schema inside origin files does it work ? i did but nothing changed Commented Sep 25, 2012 at 14:19
  • 1
    You need to put hook_schema in the .install file and implement hook_update_n in combination with db_create_table. Hook_schema is for people installing the module (feature) from scratch, the update for people who have the module already installed. See https://drupal.org/node/150215 for more details
    – Bart
    Commented Sep 25, 2012 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.