Merge branch 'master' into 330
[getmangos.git] / sql / updates / 8409_01_characters_guild.sql
blob7d879a811603dd77caf8c81cfcd0b550810e54a7
1 ALTER TABLE character_db_version CHANGE COLUMN required_8402_02_characters_guild_bank_eventlog required_8409_01_characters_guild bit;
4 -- Change createdate column type from datetime to bigint(20)
6 -- add temporary column
7 ALTER TABLE guild ADD COLUMN created_temp bigint(20) default '0';
8 -- update temporary columns data
9 UPDATE guild SET created_temp = UNIX_TIMESTAMP(createdate);
10 -- drop current column
11 ALTER TABLE guild DROP COLUMN createdate;
12 -- create new column with correct type
13 ALTER TABLE guild ADD COLUMN createdate bigint(20) NOT NULL default '0' AFTER motd;
14 -- copy data to new column
15 UPDATE guild set createdate = created_temp;
16 -- remove old column
17 ALTER TABLE guild DROP COLUMN created_temp;