As per docs, removing field shouldn't drop the column from db. Also, in dev environment it also doesn't. But for safety, take backup of secret_key field to secret_key_backup column to prevent any mishap.
Use bench mariadb to run this SQL code.
ALTER TABLE `tabSubscription` ADD secret_key_backup varchar(140);
SET SQL_SAFE_UPDATES = 0;
UPDATE `tabSubscription` SET secret_key_backup=secret_key;
SET SQL_SAFE_UPDATES = 1;
~Remove Secret Key field from Subscription doctype using Customize~ While doing, framework assumed it as standard field and wasn't allowing to remove it (maybe because it has no custom_ prefix, So skipped).
Run git pull and bench migrate and bench restart --web on prod
If everything looks good, drop the backup column
ALTER TABLE `tabSubscription` DROP COLUMN secret_key_backup;
Steps for migration -
As per docs, removing field shouldn't drop the column from db. Also, in dev environment it also doesn't. But for safety, take backup of
secret_key
field tosecret_key_backup
column to prevent any mishap.Use
bench mariadb
to run this SQL code.Secret Key
field fromSubscription
doctype usingCustomize
~ While doing, framework assumed it as standard field and wasn't allowing to remove it (maybe because it has nocustom_
prefix, So skipped).git pull
andbench migrate
andbench restart --web
on prodIf everything looks good, drop the backup column