ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 7689


Ignore:
Timestamp:
Jul 10, 2008, 7:58:22 PM (13 years ago)
Author:
ebihara
Message:

#2807:PostgreSQL 版セットアップSQLで、 ALTER TABLE ... ADD COLUMN 時にデフォルト値と NOT NULL 制約を追加してしまっている箇所があったのを修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/setup/sql/postgres74/upgrade/upgrade-2.10to2.12.sql

    r7681 r7689  
    3434
    3535-- update04
    36 ALTER TABLE c_member_pre ADD COLUMN login_id varchar(255) NOT NULL default '';
     36ALTER TABLE c_member_pre ADD COLUMN login_id varchar(255);
     37ALTER TABLE c_member_pre ALTER COLUMN login_id SET DEFAULT '';
     38UPDATE c_member_pre SET login_id = '';
     39ALTER TABLE c_member_pre ALTER COLUMN login_id SET NOT NULL;
    3740
    3841-- update05
     
    157160
    158161-- update09
    159 ALTER TABLE c_message ADD COLUMN filename varchar(200) NOT NULL default '';
     162ALTER TABLE c_message ADD COLUMN filename varchar(200);
     163ALTER TABLE c_message ALTER COLUMN filename SET DEFAULT '';
     164UPDATE c_message SET filename = '';
     165ALTER TABLE c_message ALTER COLUMN filename SET NOT NULL;
    160166
    161167-- update10
     
    186192
    187193-- update11
    188 ALTER TABLE c_member ADD COLUMN public_flag_birth_month_day varchar(20) NOT NULL default 'public';
    189 ALTER TABLE c_member_pre ADD COLUMN public_flag_birth_month_day varchar(20) NOT NULL default 'public';
     194ALTER TABLE c_member ADD COLUMN public_flag_birth_month_day varchar(20);
     195ALTER TABLE c_member ALTER COLUMN public_flag_birth_month_day SET DEFAULT 'public';
     196UPDATE c_member SET public_flag_birth_month_day = 'public';
     197ALTER TABLE c_member ALTER COLUMN public_flag_birth_month_day SET NOT NULL;
     198
     199ALTER TABLE c_member_pre ADD COLUMN public_flag_birth_month_day varchar(20);
     200ALTER TABLE c_member_pre ALTER COLUMN public_flag_birth_month_day SET DEFAULT 'public';
     201UPDATE c_member_pre SET public_flag_birth_month_day = 'public';
     202ALTER TABLE c_member_pre ALTER COLUMN public_flag_birth_month_day SET NOT NULL;
    190203
    191204-- update12, update13, update17
    192 ALTER TABLE c_commu_topic ADD COLUMN u_datetime timestamp NOT NULL default '0000-01-01 00:00:00';
     205ALTER TABLE c_commu_topic ADD COLUMN u_datetime timestamp;
     206ALTER TABLE c_commu_topic ALTER COLUMN u_datetime SET DEFAULT '0000-01-01 00:00:00';
     207UPDATE c_commu_topic SET u_datetime = '0000-01-01 00:00:00';
     208ALTER TABLE c_commu_topic ALTER COLUMN u_datetime SET NOT NULL;
    193209
    194210DROP INDEX c_commu_topic_r_datetime_c_commu_id;
     
    264280);
    265281
    266 ALTER TABLE c_cmd ADD COLUMN url varchar(128) NOT NULL default '';
     282ALTER TABLE c_cmd ADD COLUMN url varchar(128);
     283ALTER TABLE c_cmd ALTER COLUMN url SET DEFAULT '';
     284UPDATE c_cmd SET url = '';
     285ALTER TABLE c_cmd ALTER COLUMN url SET NOT NULL;
    267286
    268287ALTER TABLE c_cmd DROP CONSTRAINT "c_cmd_name_key";
    269288DROP INDEX c_cmd_name_2;
    270289
    271 ALTER TABLE c_cmd ADD COLUMN c_cmd_caster_id int4 NOT NULL default '0';
    272 ALTER TABLE c_cmd ADD COLUMN r_datetime timestamp NOT NULL default '0000-01-01 00:00:00';
    273 ALTER TABLE c_cmd ADD COLUMN u_datetime timestamp NOT NULL default '0000-01-01 00:00:00';
     290ALTER TABLE c_cmd ADD COLUMN c_cmd_caster_id int4;
     291ALTER TABLE c_cmd ALTER COLUMN c_cmd_caster_id SET DEFAULT '0';
     292UPDATE c_cmd SET c_cmd_caster_id = '0';
     293ALTER TABLE c_cmd ALTER COLUMN c_cmd_caster_id SET NOT NULL;
     294
     295ALTER TABLE c_cmd ADD COLUMN r_datetime timestamp;
     296ALTER TABLE c_cmd ALTER COLUMN r_datetime SET DEFAULT '0000-01-01 00:00:00';
     297UPDATE c_cmd SET r_datetime = '0000-01-01 00:00:00';
     298ALTER TABLE c_cmd ALTER COLUMN r_datetime SET NOT NULL;
     299
     300ALTER TABLE c_cmd ADD COLUMN u_datetime timestamp;
     301ALTER TABLE c_cmd ALTER COLUMN u_datetime SET DEFAULT '0000-01-01 00:00:00';
     302UPDATE c_cmd SET u_datetime = '0000-01-01 00:00:00';
     303ALTER TABLE c_cmd ALTER COLUMN u_datetime SET NOT NULL;
    274304
    275305-- update15
    276 ALTER TABLE c_member_config ADD COLUMN name varchar(64) NOT NULL default '';
     306ALTER TABLE c_member_config ADD COLUMN name varchar(64);
     307ALTER TABLE c_member_config ALTER COLUMN name SET DEFAULT '';
     308UPDATE c_member_config SET name = '';
     309ALTER TABLE c_member_config ALTER COLUMN name SET NOT NULL;
    277310
    278311UPDATE c_member_config SET name = c_member_config_option.name
Note: See TracChangeset for help on using the changeset viewer.