ALTER TABLE email_batches ADD COLUMN type VARCHAR(64) NOT NULL DEFAULT 'JamRuby::EmailBatch';
ALTER TABLE email_batches ADD COLUMN sub_type VARCHAR(64);

ALTER TABLE email_batches ALTER COLUMN body DROP NOT NULL;
ALTER TABLE email_batches ALTER COLUMN subject DROP NOT NULL;

ALTER TABLE email_batch_sets ADD COLUMN trigger_index INTEGER NOT NULL DEFAULT 0;
ALTER TABLE email_batch_sets ADD COLUMN sub_type VARCHAR(64);
ALTER TABLE email_batch_sets ADD COLUMN user_id VARCHAR(64);

CREATE INDEX email_batch_sets_progress_idx ON email_batch_sets(user_id, sub_type);
CREATE INDEX users_musician_email_idx ON users(subscribe_email, musician);

UPDATE users set first_social_promoted_at = first_liked_us;
ALTER TABLE users DROP column first_liked_us;