Revision history for database `ppc`

1.59    2009.10.14
    # добавить новое поле с тематическими флагами для объявления
    alter table banners add column flags text; 

1.58    2009.10.14
# удалить устаревшие визиточные поля из banners
ppc: 
alter table banners drop column address_id    
, drop column geo_id        
, drop column phone         
, drop column name          
, drop column city          
, drop column contactperson 
, drop column worktime      
, drop column country       
, drop column street        
, drop column house         
, drop column build         
, drop column apart         
, drop column extra_message 
, drop column contact_email 
, drop column im_client     
, drop column im_login;



1.57    2009.10.07
        ppc:
        alter table users_units drop primary key, add primary key (uid, scheme);

1.56    2009.09.29
        monitor:
        alter table xls_checkin add column sign bigint(20) unsigned default NULL, add index (sign, cid);

1.55    2009.09.23
	ppc:
	# таблица для хранения грубого прогноза трат кампаний
	create table camp_rough_forecast (
	    cid int unsigned,
	    forecast_time timestamp,
	    forecast_time_end timestamp,
	    forecast_sum decimal(10,6),
	    primary key (cid, forecast_time)
	);
	
1.54    2009.09.01
        ppc:
        ALTER TABLE users_units ADD column scheme enum('API','XLS') NOT NULL default 'API' after uid;

        # uploaded XLS files   
        monitor_db:
        CREATE TABLE xls_checkin (
            id int(10) unsigned NOT NULL auto_increment,
            cid int(10) unsigned NOT NULL,
            compressed_data mediumblob NOT NULL,
            logdate timestamp NOT NULL default CURRENT_TIMESTAMP,
            PRIMARY KEY  (id),
            KEY cid (cid)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        # exported XLS files   
        monitor_db:
        CREATE TABLE xls_checkout (
            id int(10) unsigned NOT NULL auto_increment,
            cid int(10) unsigned NOT NULL,
            half_md5_hash bigint(20) unsigned NOT NULL,
            yaml_data mediumblob NOT NULL,
            logdate timestamp NOT NULL default CURRENT_TIMESTAMP,
            PRIMARY KEY  (id),
            UNIQUE KEY md5hash (half_md5_hash,cid),
            KEY cid (cid)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        # server stored session data 
        monitor_db:
        CREATE TABLE stored_vars (
            id int(10) unsigned NOT NULL auto_increment,
            cid int(10) unsigned NOT NULL,
            uid int(10) unsigned NOT NULL,
            name bigint(20) unsigned NOT NULL,
            yaml_data mediumblob NOT NULL,
            logdate timestamp NOT NULL default CURRENT_TIMESTAMP,
            PRIMARY KEY  (id),
            UNIQUE KEY name (name,cid,uid),
            KEY cid (cid,uid),
            KEY uid (uid)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        # universal lock_objects
        ppcdict_db:
        CREATE TABLE lock_object (
            id bigint(20) unsigned NOT NULL auto_increment,
            object_id bigint(20) unsigned NOT NULL,
            object_type enum('user','campaign','banner') NOT NULL default 'campaign',
            half_md5_hash bigint(20) unsigned NOT NULL default '0',
            lock_time timestamp NOT NULL default '0000-00-00 00:00:00',
            PRIMARY KEY  (id),
            UNIQUE KEY object_id (object_id,object_type),
            KEY lock_time (lock_time)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


1.54    2009.09.21
        PPC:
            alter table camp_options add column `statusPostModerate` enum('New', 'Yes', 'No') NOT NULL default 'New';
        
        PPCDICT:
            create table yaco_classify_url (url_hash bigint(16) not null default 0, categories varchar(255) default '', url text NOT NULL default '', primary key('url_hash'));

1.53    2009.09.11
        PPC
        CREATE TABLE clients_geo_ip (
            ClientID int(10) unsigned NOT NULL,
            geo_id_by_ip int(10) unsigned NOT NULL default '0',
            update_time timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
            office_id_by_ip int(10) unsigned NOT NULL default '0',
            office_name varchar(15) NOT NULL,
            PRIMARY KEY  (ClientID),
            KEY geo_id_by_ip (geo_id_by_ip),
            KEY office_id_by_ip (office_id_by_ip)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        CREATE TABLE geo_translation (
            region int(11) NOT NULL default '0',
            direct_region int(11) NOT NULL default '0',
            region_name varchar(255) default NULL,
            PRIMARY KEY  (region)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        PPCDICT
        alter table yandex_offices add column serviced_regions varchar(255) not null;
        alter table yandex_offices add column office_short_name varchar(15) not null;
        update yandex_offices set serviced_regions="213,3,225,0,26,40", office_short_name="Мск" where office_id=1;
        update yandex_offices set serviced_regions="17", office_short_name="Спб" where office_id=2;
        update yandex_offices set serviced_regions="11108,11111,52,59,73", office_short_name="Екб" where office_id=3;
        update yandex_offices set serviced_regions="187", office_short_name="Одесса" where office_id=4;

        MONITOR
        CREATE TABLE clients_geo_ip_cache (
            uid bigint(20) unsigned NOT NULL,
            ip varchar(16) NOT NULL,
            hits_cnt int(10) unsigned NOT NULL,
            PRIMARY KEY  (uid,ip)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        DROP TABLE clients_geo_ip;

1.52    2009.09.16
        # визитки -- в отдельную таблицу vcards

# DevTest: Query OK, 5880493 rows affected (8 min 43.51 sec)
alter table banners 
    add vcard_id int(10) default null, 
    add key i_vcard_id(vcard_id);

# DevTest: Query OK, 52887 rows affected (3.06 sec)
alter table mediaplan_banners 
    add vcard_id int(10) default null,
    add key i_vcard_id(vcard_id);

CREATE TABLE vcards (
  vcard_id int(10) NOT NULL auto_increment,
  cid int(10) NOT NULL,
  uid bigint(20) NOT NULL,
  address_id int(10) unsigned default NULL, 
  geo_id int(10) NOT NULL default '0', 
  phone varchar(25) default NULL,
  name varchar(255) default NULL, 
  city varchar(55) default NULL,
  contactperson varchar(155) default NULL,
  worktime varchar(255) default NULL,
  country varchar(50) default NULL,
  street varchar(55) default NULL,
  house varchar(10) default NULL,
  build varchar(10) default NULL,
  apart varchar(10) default NULL, 
  extra_message text,
  contact_email varchar(255) default NULL, 
  im_client varchar(25) default NULL,
  im_login varchar(255) default NULL,

  PRIMARY KEY  (vcard_id),
  KEY i_cid(cid),
  KEY i_uid(uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



1.51    2009.09.14
	ppclog:
	# логирование тормозов рендеринга на стороне клиента
	create table log_long_renders (
		reqid bigint not null,
		logtime timestamp,
		render_time float not null,
		user_agent varchar(200),
		index(reqid)
	);

1.50    2009.09.03
        alter table camp_options add column stopTime timestamp not null default '0000-00-00 00:00:00' after lastchanged;

1.49    2009.07.01
        # campaigns description
        alter table users_options add use_camp_description enum('No', 'Yes') NOT NULL default 'No';
        alter table camp_options add camp_description TEXT default NULL;

        # campaigns favorite for users
        CREATE TABLE user_campaigns_favorite (
            uid bigint(20) unsigned NOT NULL default 0,
            cid int(10) unsigned NOT NULL default 0,
            UNIQUE KEY (uid, cid)
        );

1.48    2009.08.28
	ppc:
                alter table users_options add column manager_office_id tinyint unsigned default null COMMENT 'office of manager (meaningful only for managers)' after is_ukr_manager;
	        update users_options set manager_office_id = 4 where is_ukr_manager = 'Yes';
	
	ppcdict:
		set names utf8;
                create table yandex_offices (
			office_id tinyint unsigned not null primary key auto_increment,
			office_name varchar(100) not null,
			office_nick varchar(100) not null,
			servicing_border decimal(10,6) not null
			);
		insert into yandex_offices (office_id, office_name, office_nick, servicing_border)
	               values (1, 'Москва', 'msk', 300), (2, 'Санкт-Петербург', 'spb', 300), (3, 'Екатеринбург', 'ekb', 300), (4, 'Украина', 'ukr', 300);
		
1.47    2009.08.24
        # added uid of primary manager on agency (for bayan)
        alter table clients add primary_bayan_manager_uid int(10) unsigned after primary_manager_uid;

1.46    2009.08.11
	create table camp_bs_queue (cid int unsigned not null primary key, bs_queue tinyint unsigned default null, new_bs_queue tinyint unsigned default null);
	create table camp_unsync_0 (cid int unsigned not null primary key);
	create table camp_unsync_1 (cid int unsigned not null primary key);
	create table camp_unsync_2 (cid int unsigned not null primary key);
	create table camp_unsync_3 (cid int unsigned not null primary key);
	create table camp_unsync_4 (cid int unsigned not null primary key);

1.46    2009.08.11
        alter table clients add last_stopped_warn_mail datetime
                          , add sum_on_stopped_camps decimal(16,6);

1.45    2009.08.11
                alter table users add column showOnYandexOnly enum('Yes','No') NOT NULL default 'No' COMMENT 'User can create only yandex advertising, which shows only on Yandex pages' after statusYandexAdv;

1.44    2009.07.16
		alter table mediaplan_stats modify optimize_type SET('your_opinion','restore_disabled','improve_text','add_minus_words','specify_links','clear_disabled','add_rubrics','break_blocks') default NULL,		
 		modify text_type SET('brand_name','illumination','template') default NULL;

1.43    2009.07.16
        ppcdict:
        
        create table warn_pay (
            id int auto_increment,
            uid int not null default '0',
            cid int not null default 0,
            email varchar(50) not null default '',
            create_time timestamp NOT NULL default CURRENT_TIMESTAMP,
            warned_interval tinyint not null default 100,
            primary key(`id`),
            index `i_warnint`(`warned_interval`),
            unique `i_warn_cid`(`cid`)
        );
        
1.42    2009.07.13
		alter table mediaplan_stats modify request_type enum('keywords_text','keywords','text','optimize','optimize_wo_ext','optimize_ext') default NULL,
		add optimize_type enum('your_opinion','restore_disabled','improve_text','add_minus_words','specify_links','clear_disabled','add_rubrics','break_blocks') default NULL,
		add difficulty_type enum('lite','standard','max') default NULL,
 		add text_type enum('brand_name','illumination','template') default NULL;

1.41    2009.06.25
        # strategies
        alter table camp_options
        add manual_autobudget_sum double, 
        add budget_strategy enum ('distributed', 'fast') default 'distributed',
        add positions_strategy enum ('low', 'middle', 'high') default 'middle',
        add autobudgetFromStrategyDate datetime default null;


1.40	2009.06.23
        # removed obsolete AgencyDiscount from users (DIRECT-3061)
        alter table users drop AgencyDiscount;

        -- Query OK, 483878 rows affected (19.47 sec)
        -- Records: 483878  Duplicates: 0  Warnings: 0

1.39	2009.06.22
		# add easy user flag to first aid
		alter table optimizing_campaign_requests add is_easy_user enum('Yes','No') default 'No';

1.38	2009.06.09
		# for storing ctr when banner copied from active banners to mediaplan 
		alter table mediaplan_bids add bsIdHistory varchar(100);

1.37    2009.06.09
        # now camp sum stat in direct_stat.bs_order_stat (PPC_MONITOR_DB)
        drop table camp_sums;

1.36    2009.06.07
        # Url-Client pairs transport to crm
        # queue itself 
        CREATE TABLE client_urls_crm_queue (
            sync_id bigint(20) unsigned NOT NULL auto_increment,
            record_id int(10) unsigned NOT NULL,
            PRIMARY KEY  (sync_id),
            UNIQUE KEY record_id (record_id)
        )
        # storage
        CREATE TABLE client_urls (
            record_id int(10) unsigned NOT NULL auto_increment,
            ClientID int(10) unsigned NOT NULL default '0',
            href varchar(255) NOT NULL,
            domain varchar(255) NOT NULL,
            removed tinyint(4) NOT NULL default '0',
            logtime timestamp NOT NULL default CURRENT_TIMESTAMP,
            PRIMARY KEY  (record_id),
            UNIQUE KEY ClientID (ClientID,href),
            KEY logtime (logtime)
        )

1.35    2009.06.03
        # increase allowed length of hrefs
        alter table banners modify href varchar(1024);
        alter table media_banners modify column href varchar(1024) NOT NULL default '', modify column flash_href varchar(1024) NOT NULL default '', modify column counter_href varchar(1024) NOT NULL default '';
        alter table mediaplan_banners modify href varchar(1024);

1.34    2009.04.29
        # added uid of primary manager on agency
        alter table clients add primary_manager_uid int(10) unsigned;

1.33    2009.04.28
        # added new status of agency to "clients"
        alter table clients modify agency_status enum('CP', 'SA', 'AA', 'RCP', 'HY', 'WC') default NULL COMMENT 'DIRECT-1507, DIRECT-2618';

1.32    2009.04.22
        # added create date and status of agency to "clients"
        alter table clients
          add create_date timestamp NOT NULL default CURRENT_TIMESTAMP after name,
          add agency_status enum('CP', 'SA', 'AA') default NULL COMMENT 'DIRECT-1507';

        # update create_date for old agencies
        insert into clients (ClientID, create_date)
        select u.ClientID, MIN(DATE(FROM_UNIXTIME(createtime)))
        from users u
        join campaigns c on c.AgencyUID = u.uid
          where c.AgencyUID > 0
        group by u.ClientID
        on duplicate key update
          create_date = values(create_date);

1.31    2009.04.03

        # added table for processing map's points

        alter table banners add column address_id int after `BannerID`;

CREATE TABLE `addresses` (
  `aid` int(11) NOT NULL auto_increment,
  `map_id` int(11) default NULL,
  `address` varchar(255) default NULL,
  `ahash` bigint(20) unsigned default NULL,
  `kind` enum('house','street','metro','district','locality','area','province','country','hydro','railway','route','vegetation','cemetery','bridge','km','other') default 'other',
  `precision` enum('exact','number','near','street','other') default 'other',
  `logtime` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`aid`),
  UNIQUE KEY `address` (`address`),
  KEY `ahash` (`ahash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `maps` (
  `mid` int(11) NOT NULL auto_increment,
  `x` decimal(10,6) default NULL,
  `y` decimal(10,6) default NULL,
  `x1` decimal(10,6) default NULL,
  `y1` decimal(10,6) default NULL,
  `x2` decimal(10,6) default NULL,
  `y2` decimal(10,6) default NULL,
  PRIMARY KEY  (`mid`),
  UNIQUE KEY `x` (`x`,`y`,`x1`,`y1`,`x2`,`y2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

1.30    2009.03.10
        # added table for info about ClientID
        CREATE TABLE clients (
            ClientID int(10) NOT NULL default '0',
            name TEXT default NULL COMMENT 'agency name from balance',
            deleted_reps TEXT default NULL COMMENT 'old reps list for show and re-add in cmd_showClReps, cmd_showAgReps',
            agency_url varchar(255) default NULL COMMENT 'from balance',
            PRIMARY KEY (ClientID)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

        # added client option: send mails
		alter table users_options
          add sendClientLetters enum('Yes', 'No') not null default 'Yes' COMMENT 'send mails to client rep about all campaigns',
          add sendClientSMS     enum('Yes', 'No') not null default 'Yes' COMMENT 'send SMS to client rep about all campaigns';

        # update sendClientSMS for old users
        insert into users_options (uid, sendClientSMS)
            select uid, 'Yes'
            from camp_options
              join campaigns using(cid)
            where sms_flags != ''
        on duplicate key update
          sendClientSMS = values(sendClientSMS);

        # update sendClientLetters for old users
        insert into users_options (uid, sendClientLetters)
            select uid, 'Yes'
            from users
        on duplicate key update
          sendClientLetters = values(sendClientLetters);

1.29    2009.09.10
        ppclog:
        CREATE TABLE moderate_history (
            logtime timestamp NOT NULL default CURRENT_TIMESTAMP,
            uid int(10) unsigned NOT NULL,
            cid int(10) unsigned NOT NULL,
            bid int(10) unsigned NOT NULL,
            statusModerate enum('Yes','No') NOT NULL default 'No',
            KEY (logtime, uid, cid),
            KEY (uid,cid,logtime),
            KEY (cid,logtime),
            KEY (bid,logtime)
        )

1.28    2009.04.03
		alter table mediaplan_stats add AcceptUID int(10) unsigned not null, add end_comment text;
		alter table camp_options add mediaplan_status enum('None', 'InProcess', 'Complete') default 'None';


1.27    2009.03.10
		create table used_filter_domains (filter_domain varchar(100) not null primary key) comment 'Domains with payed campaigns';

1.26    2009.03.30
       ppcdict:
       CREATE TABLE stat_rollbacks (
           id int unsigned not null primary key auto_increment,
           OrderID int unsigned not null,
           rollback_time timestamp not null,
           border_date date not null,
           status enum('New', 'InComplete', 'Complete') not null default 'New',
            index (status),
           hosts varchar(1024) not null
       );

1.25    2009.03.30
        ppcdict:
        CREATE TABLE overdraft_history (
            logdate date NOT NULL,
            ClientID int unsigned NOT NULL,
            balance_tid bigint unsigned NOT NULL,
            overdraft_lim decimal(10,2) NOT NULL,
            debt decimal(10,2) NOT NULL,
            PRIMARY KEY  (logdate,ClientID),
            KEY ClientID (ClientID,logdate)
        )

1.24    2009.03.12
       ppcdict:
       CREATE TABLE mirrors_manual (domain varchar(100) not null primary key, filter_domain varchar(100) not null) character set latin1;

1.23    2009.03.11
               #add different type rates to yacontext categories rates report
               alter table yacontext_categories_prices add popular_count int(11) not null, add popular_rate double not null, add balanced_rate double not null;
	
1.22    2009.03.05
		alter table users_options add show_fa_teaser enum('No','Yes') not null default 'No' COMMENT 'show first aid teaser for user, bypass other checks';
1.21    2009.02.17
	# Let's start work with microbucks
	alter table campaigns modify column sum_to_pay decimal(16,6) NOT NULL, modify column sum decimal(16,6) NOT NULL, modify column sum_spent decimal(16,6) NOT NULL, modify column sum_last decimal(16,6) NOT NULL;

1.20    2009.02.08
        # add statEnd & statStart into ppcstat.order_satt_info table
        # statEnd = statTime after DB modification
        ppcstat:
            alter table order_stat_info add column statStart timestamp NOT NULL default '0000-00-00 00:00:00';
            alter table order_stat_info add column statEnd timestamp NOT NULL default '0000-00-00 00:00:00';

1.19    2009.01.16
        # added statusModerate to mediaplan
        alter table mediaplan_bids add column statusModerate enum ('Yes', 'No') NOT NULL default 'Yes';
        
        # table mod_reasons
        ppcdict:
            alter table moderate_diags add column bad_reason enum('Yes','No') not null default 'Yes';

        # added statusModerate for each phrases in bids
        alter table bids_arc add column statusModerate enum ('New', 'Yes', 'No') NOT NULL default 'New' AFTER statusSync;
            Query OK, 14386881 rows affected (59 min 2.10 sec)
            Records: 14386881  Duplicates: 0  Warnings: 0
            
        alter table bids add column statusModerate enum ('New', 'Yes', 'No') NOT NULL default 'New' AFTER statusSync;
            Query OK, 16104308 rows affected (36 min 5.58 sec)
            Records: 16104308  Duplicates: 0  Warnings: 0

        # инициализация статусов у фраз после alter'a и перед запуском moderateCLientNew.pl
        update bids bi left join phrases p using(bid) set bi.statusModerate=CASE p.statusModerate WHEN 'Yes' THEN 'Yes' WHEN 'No' THEN 'No' ELSE 'New' END where bi.statusModerate!=CASE p.statusModerate WHEN 'Yes' THEN 'Yes' WHEN 'No' THEN 'No' ELSE 'New' END;
        Query OK, 15743369 rows affected (9 min 58.08 sec)
        Rows matched: 16104669  Changed: 15743369  Warnings: 0

1.18    2009.01.19
        # added type to logbalance table
        ppclog:
            ALTER TABLE logbalance add column type enum('text','mcb','socdem','anticontext') NOT NULL default 'text';

1.18    2009.01.20
	alter table campaigns add column crm_inquiry_id int unsigned not null;
	# Query OK, 1203051 rows affected (1 min 10.15 sec)
	
1.17    2009.01.19
        # added type to logbalance table
        ppclog:
            ALTER TABLE logbalance add column type enum('text','mcb','socdem','anticontext') NOT NULL default 'text';

1.16    2009.01.15
        # added rank for api reports (for monitoring)
        ppcdict: 
            ALTER TABLE api_reports_new ADD COLUMN rank tinyint default 0;
            ALTER TABLE api_reports ADD COLUMN rank tinyint default 0;

1.15    2009.01.15
        # modified width column
        ppcdict: ALTER TABLE vendor_report MODIFY COLUMN `email` varchar(255) NOT NULL;

1.14    2008.12.05
        # added auto request flag
        alter table optimizing_campaign_requests 
            add column auto_request enum('Yes','No') not null default 'No',
            modify column `status` enum('New','InProcess','Declined','Ready','Accepted','AcceptDeclined','Rejected') default 'New'

1.13    2008.11.18
    ppcdict:
        # added flags for optimizing declined new campaigns
        ALTER TABLE moderate_diags ADD COLUMN allow_first_aid enum ('Yes', 'No') default 'No';

        # set some reasons as "good"
        update moderate_diags set allow_first_aid='Yes' where diag_id in (5,13,29,6,51,8,4,63,52);

    ppc:
        # added new column
        ALTER TABLE camp_options ADD COLUMN auto_optimize_request enum('Created', 'Sended', 'No') default 'No';
        
        # added new status - AutoRequest
        ALTER TABLE optimizing_campaign_requests MODIFY COLUMN `status` enum('New','InProcess','Declined','Ready','Accepted','AcceptDeclined','Rejected','AutoRequest') default 'New';
        
1.12
    # 2008.11.19

    # fixed old users that set sendWarn = 'No'
    update users set sendWarn = 'No' where sendWarn is null;

    # set users.sendWarn NOT NULL
    alter table users modify column sendWarn enum('Yes', 'No') NOT NULL default 'Yes';

    -- Query OK, 287219 rows affected (11.34 sec)
    -- Records: 287219  Duplicates: 0  Warnings: 0

1.11 
    alter table optimizing_campaign_requests add ready_time datetime;
    alter table optimizing_campaign_requests add accept_time datetime;
    alter table optimizing_campaign_requests add start_time datetime;
    alter table optimizing_campaign_requests add reject_comment text;    
    alter table optimizing_campaign_requests modify status enum('New','InProcess','Declined','Ready','Accepted','AcceptDeclined', 'Rejected') default 'New';
    alter table optimizing_campaign_requests modify column create_time timestamp NOT NULL default CURRENT_TIMESTAMP;

1.10
        2008.10.21
        # added 'region' field in informer_shows_stat
        alter table informer_shows_stat add region int(10) NOT NULL default '0' after statdate, drop PRIMARY KEY, add PRIMARY KEY (statdate, region);


1.9
        2008.10.17
        # Changed type of FirstAid request table
        alter table optimizing_campaign_requests modify column create_time datetime not null;


1.8     2008.10.08
	# user_options.sendAgencyMcbLetters
	alter table users_options add column sendAgencyMcbLetters enum('No','Yes') not null default 'No'
              comment 'manager with this flag will recieve copy of all agency mcb letters';
        
1.7     2008.10.01
        # added re-moderation camapigns
        
CREATE TABLE `pre_moderate` (
  `cid` int(10) NOT NULL default '0',
  PRIMARY KEY  (`cid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        
        
1.6     2008.08.22
        # added database for bs logs
        
        > mysql -AU -uadiuser -putro -hppc -P3309
        > mysql -AU -uadiuser -putro -hppcstandby01d -P3309
        
        create database ppclog_bs;
    
1.5     2008.10.01
        # pdf_reports.status_no_data

        alter table pdf_reports
            add column status_no_data enum('Yes', 'No') not null default 'No'
            after rank
        ;

1.4     2008.09.17
        # campaigns.statusActive

	alter table campaigns
	    add column statusActive enum('Yes', 'No') not null default 'No'
	    comment 'Real order status on BS frontend'
	    after statusShow
	;
	-- Query OK, 1113867 rows affected (57.04 sec)
	create table camp_activization (cid int unsigned not null primary key, send_time timestamp not null);

1.3     2008.08.21
        # added number times to process report

        alter table api_reports add column rank tinyint default '0';
        
1.2     2008.07.31

        alter table campaigns modify ContextLimit tinyint unsigned not null default 0 comment '0 - auto, 254 - shows disabled, 255 - limiting disabled'
	                    , add ContextPriceCoef tinyint unsigned not null default 100 after ContextLimit;
        39.07 sec
	update campaigns set ContextLimit = case when dontShowYacontext = 'Yes' then 254
	                                         else ContextLimit end
	                   , ContextPriceCoef = 100;

1.1     2008.07.31  mirage
        # added column for check changes from selected package in interface
        
        alter table media_groups add column `different_mcb_theme` enum('Yes', 'No') not null default 'No' COMMENT 'Phrases from another package';

1.0     2008.06.06  mirage

        # deleted not using column - BalanceBlocked
        # added new columns for api's campaigns

        alter table campaigns 
                    drop column BalanceBlocked,
                    add column api_access_time datetime,
                    add column statusAPI enum('Yes', 'No') not null default 'No',
                    add key `i_camp_status_api`(`statusAPI`);



