Skip to content

Instantly share code, notes, and snippets.

@Kobedinho
Created November 27, 2014 18:26
Show Gist options
  • Save Kobedinho/09075749739c9657b92f to your computer and use it in GitHub Desktop.
Save Kobedinho/09075749739c9657b92f to your computer and use it in GitHub Desktop.
script para agregar campo autoincremental a una tabla existente (multiples campos autonumericos)
// esta funcion se ejecuta mediante un paquete
function post_install()
{
global $db;
$query = "ALTER TABLE table_name MODIFY COLUMN table_column int(11) auto_increment NOT NULL, ADD KEY(table_column);";
$res = $db->query($query);
echo "---- Terminando ----";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment