Skip to content

Instantly share code, notes, and snippets.

@DasBlub
Created April 11, 2010 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DasBlub/363079 to your computer and use it in GitHub Desktop.
Save DasBlub/363079 to your computer and use it in GitHub Desktop.
ALTER TABLE characters ADD deleteDate_tmp TIMESTAMP NULL DEFAULT NULL; -- add temp field
UPDATE characters SET deleteDate_tmp = deleteDate; -- set the value of the temp field
ALTER TABLE characters DROP deleteDate; -- drop the original field
ALTER TABLE characters ADD deleteDate BIGINT(20) NULL DEFAULT NULL; -- add bigint(20) for the unix timestamp
UPDATE characters SET deleteDate = UNIX_TIMESTAMP(deleteDate_tmp); -- set the unix timestamp
ALTER TABLE characters DROP deleteDate_tmp; -- drop the temp field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment