JAFFAR

Blog

Drop Primary key and add primary key in Drupal 6

Posted by jaffar on June 9, 2013 at 1:45 AM

  How to set primary key in by using modules in drupal 6.  The below code is used to execute the primary key in a table

section_sidebar is a table name  sbid is the primary key of the table section_sidebar

 

<?php

$ret = array();

db_drop_primary_key($ret, 'section_sidebar');

db_add_primary_key($ret, 'section_sidebar', array('sbid'));

 

db_drop_index($ret, 'section_sidebar', 'sidebar_block_w_h');

db_add_index($ret,'section_sidebar', 'sidebar_block_w_h', array('weight', 'hide'));


?>

 

 

Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments