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