Added SQL backend to storage of assigned flags.