How to add a column to DB with weight by using hook_update_N? I want to add a column to a database by using hook_update_N(), but it should be 3rd column instead of last column. How I can achieve that please help in this regard. I tried to add weight but not working. below is my code which is creating a column at the last in the existed table.

function test_update_7001() {
  $column3 = array(
    'type' =&gt; 'varchar',
    'length' =&gt; 256,
    'not null' =&gt; FALSE,
    'weight' =&gt; 3,
  );
  db_add_field('test_table', 'column3', $column3);
}
db_add_field doesn't support AFTER, which you would need to create your desired query. 

You'll need to build an appropriate SQL string and run it through db_query() instead.