You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1891 - hogum:drop_email_column, r=carols10cents
Drop Email column (merge and deploy the fix for #1888 first!)
#### Fixes#1889
This cleans up the uses of the field `email` from `User` by:
- dropping the `email` field from `User`
- clearing references to the dropped email field
- migrating and updating the schema changes
CREATEFUNCTIONupdate_categories_crates_cnt() RETURNS trigger AS $$ BEGIN IF (TG_OP ='INSERT') THEN UPDATE categories SET crates_cnt = crates_cnt +1WHERE id =NEW.category_id; return NEW; ELSIF (TG_OP ='DELETE') THEN UPDATE categories SET crates_cnt = crates_cnt -1WHERE id =OLD.category_id; return OLD; END IF; END $$ LANGUAGE plpgsql; CREATE TRIGGER trigger_update_categories_crates_cnt BEFORE INSERT ORDELETEON crates_categories FOR EACH ROW EXECUTE PROCEDURE update_categories_crates_cnt(); CREATE TRIGGER touch_crate_on_modify_categories AFTER INSERT ORDELETEON crates_categories FOR EACH ROW EXECUTE PROCEDURE touch_crate();
1
+
CREATEFUNCTIONupdate_categories_crates_cnt() RETURNS trigger AS $$ BEGIN IF (TG_OP ='INSERT') THEN UPDATE categories SET crates_cnt = crates_cnt +1WHERE id =NEW.category_id; return NEW; ELSIF (TG_OP ='DELETE') THEN UPDATE categories SET crates_cnt = crates_cnt -1WHERE id =OLD.category_id; return OLD; END IF; END $$ LANGUAGE plpgsql; CREATE TRIGGER trigger_update_categories_crates_cnt BEFORE INSERT ORDELETEON crates_categories FOR EACH ROW EXECUTE PROCEDURE update_categories_crates_cnt(); CREATE TRIGGER touch_crate_on_modify_categories AFTER INSERT ORDELETEON crates_categories FOR EACH ROW EXECUTE PROCEDURE touch_crate();
0 commit comments