Changing field type in production

1
2
3
4
5
6
7
begin;
alter table web_child add column strnum varchar(10);
update web_child set strnum = to_char(schoolstd,'999');
alter table web_child alter column strnum set not null;
alter table web_child drop column schoolstd;
alter table web_child rename column strnum to schoolstd;
commit;

More like this

  1. django-admin custom filter: IS NULL/IS NOT NULL by Eloff 2 years, 2 months ago
  2. RelatedNullFilterSpec: django-admin custom filter all/null/not null/choices by Codeko 1 year, 7 months ago
  3. TrueNoneField by diverman 2 years, 5 months ago
  4. Simple solution for model schema evolution / database changelog by kahless 4 years, 11 months ago
  5. Improved Pickled Object Field by taavi223 2 years, 9 months ago

Comments

(Forgotten your password?)