ALTER COLUMN data SET DEFAULT '{}'::jsonb")
execute(~s(ALTER TABLE users
- ALTER COLUMN following SET DEFAULT ARRAY[]::character varying[],
ALTER COLUMN tags SET DEFAULT ARRAY[]::character varying[],
ALTER COLUMN notification_settings SET DEFAULT
'{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb))
"UPDATE users SET pleroma_settings_store = '{}'::jsonb where pleroma_settings_store IS NULL"
)
- execute("UPDATE users SET following = ARRAY[]::character varying[] WHERE following IS NULL")
execute("UPDATE users SET tags = ARRAY[]::character varying[] WHERE tags IS NULL")
execute(~s(UPDATE users SET notification_settings =
'{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb
ALTER COLUMN data DROP DEFAULT")
execute("ALTER TABLE users
- ALTER COLUMN following DROP DEFAULT,
ALTER COLUMN tags DROP DEFAULT,
ALTER COLUMN notification_settings SET DEFAULT '{}'::jsonb")
end
execute("UPDATE users SET follower_count = 0 WHERE follower_count IS NULL")
execute("ALTER TABLE users
- ALTER COLUMN following SET NOT NULL,
ALTER COLUMN local SET NOT NULL,
ALTER COLUMN source_data SET NOT NULL,
ALTER COLUMN note_count SET NOT NULL,
def down do
execute("ALTER TABLE users
- ALTER COLUMN following DROP NOT NULL,
ALTER COLUMN local DROP NOT NULL,
ALTER COLUMN source_data DROP NOT NULL,
ALTER COLUMN note_count DROP NOT NULL,